using System;
using System.Collections.Generic;
using ECOT.Engine;
using Microsoft.Xna.Framework;
using System.Globalization;

namespace ECOT.Game
{
    /// <summary>
    /// 
    /// </summary>
    public static class Rules
    {
        #region Game properties

        public static readonly CultureInfo DefaultLocale = CultureInfo.GetCultureInfo("en");

        #endregion

        #region Logic

        public static readonly int SecondsPerDay = 2;

        #endregion

        #region Buildings

        public static class Buildings
        {
            #region Water

            public static class Water
            {
                public static BuildingInfo WaterTower =
                    new BuildingInfo(Text.BuildingsWaterTower, 210, 8, 3500, 11, 350, int.MaxValue, int.MaxValue, 8, new Rectangle(64, 768, 64, 128), false);
            }

            #endregion

            #region Food

            public static class Food
            {
                public static BuildingInfo WacDonald =
                    new BuildingInfo(Text.BuildingsWacDonald, 200, 10, 3200, 11, 320, int.MaxValue, int.MaxValue, 8, new Rectangle(0, 768, 64, 128), false);
            }

            #endregion

            #region Energy

            public static class Energy
            {
                public static BuildingInfo WindMachine =
                    new BuildingInfo(Text.BuildingsWindMachine, 80, 12, 2000, 8, 200, int.MaxValue, int.MaxValue, 5, 98, true, Rectangle.Empty, false);
            }

            #endregion

            #region Education

            public static class Education
            {
                public static BuildingInfo School =
                    new BuildingInfo(Text.BuildingsSchool, 1800, 10, 3500, 8, 350, int.MaxValue, int.MaxValue, 5, new Rectangle(64, 640, 64, 128), false);
            }

            #endregion

            #region Ecology

            public static class Ecology
            {
                public static BuildingInfo SmallPark =
                    new BuildingInfo(Text.BuildingsSmallPark, 0, -30, 2000, 8, 200, 3, int.MaxValue, 5, new Rectangle(256, 640, 64, 128), false);
                public static BuildingInfo MediumPark =
                    new BuildingInfo(Text.BuildingsMediumPark, 0, -50, 3500, 11, 350, 3, int.MaxValue, 8, new Rectangle(320, 512, 64, 128), false);
            }

            #endregion
        }

        #endregion

        #region Cities

        public static class Cities
        {
            public static readonly int MaxDrawArea = 3;
            public static readonly Size Size = new Size(2, 2);
        }

        #endregion


        public static void OnLocaleChangeHandler(CultureInfo locale)
        {
            #region Buildings

            Buildings.Energy.WindMachine.Name = Text.BuildingsWindMachine;

            Buildings.Education.School.Name = Text.BuildingsSchool;

            Buildings.Ecology.SmallPark.Name = Text.BuildingsSmallPark;
            Buildings.Ecology.MediumPark.Name = Text.BuildingsMediumPark;

            #endregion
        }
    }
}
