Exemplo n.º 1
0
        internal void AddCombatHero(Creature c)
        {
            Debug.Assert(c != null);
            Debug.Assert(CombatHeroes.IndexOf(c) == -1);
            Debug.Assert(c.IsLive);

            CombatHeroes.Add(c);
            CombatHeroes.Sort(ComparePlaceCreature);
        }
Exemplo n.º 2
0
        internal void CalcResultTurn()
        {
            if (IsLive == true)
            {
                Gold += Income();

                ValidateHeroes();

                QuantityHeroes = CombatHeroes.Count();

                if (DurabilityCastle <= 0)
                {
                    IsLive   = false;
                    DayOfDie = Lobby.Turn;
                }

                PointConstructionGuild    = Lobby.TypeLobby.PointConstructionGuildPerDay;
                PointConstructionEconomic = Lobby.TypeLobby.PointConstructionEconomicPerDay;
            }
        }
Exemplo n.º 3
0
        protected void RearrangeHeroes()
        {
            // Очищаем все координаты героев
            foreach (Creature ph in CellHeroes)
            {
                if (ph != null)
                {
                    Debug.Assert(ph.IsLive);

                    CellHeroes[ph.CoordInPlayer.Y, ph.CoordInPlayer.X] = null;
                    ph.CoordInPlayer = new Point(-1, -1);
                }
            }

            // Проставляем координаты для героев
            foreach (Creature ph in CombatHeroes.OrderBy(ph => ph.Priority()))
            {
                SetPosForHero(ph);
            }
        }