Esempio n. 1
0
        public Player(ICivilization civilization, string customLeaderName = null, string customTribeName = null, string customTribeNamePlural = null)
        {
            _civilization = civilization;
            if (customLeaderName != null)
            {
                _civilization.Leader.Name = customLeaderName;
            }
            _tribeName       = customTribeName ?? _civilization.Name;
            _tribeNamePlural = customTribeNamePlural ?? _civilization.NamePlural;
            Government       = new Despotism();

            for (int xx = 0; xx < Map.WIDTH; xx++)
            {
                for (int yy = 0; yy < Map.HEIGHT; yy++)
                {
                    _explored[xx, yy] = false;
                    _visible[xx, yy]  = false;
                }
            }
        }
Esempio n. 2
0
        public void NewTurn()
        {
            if (!Game.GetCities().Any(x => this == x.Owner) && !Game.Instance.GetUnits().Any(x => this == x.Owner))
            {
                GameTask.Enqueue(Turn.GameOver(this));
            }

            if (_anarchy == 0 && Government is Anarchy)
            {
                if (Human == Game.CurrentPlayer)
                {
                    GameTask.Enqueue(Show.ChooseGovernment);
                }
                else
                {
                    Government = new Despotism();
                }
            }
            if (_anarchy > 0)
            {
                _anarchy--;
            }
        }