Exemplo n.º 1
0
        public void OnTick()
        {
            if (CurrentDuel != null)
            {
                CurrentDuel.OnTick();
            }

            foreach (KeyValuePair <ArenaDuel, DateTime> kvp in PendingDuels)
            {
                if (kvp.Value < DateTime.UtcNow)
                {
                    _Remove.Add(kvp.Key);
                }
            }

            if (_Remove.Count > 0)
            {
                foreach (ArenaDuel duel in _Remove)
                {
                    if (PendingDuels.ContainsKey(duel))
                    {
                        PendingDuels.Remove(duel);
                    }
                }

                _Remove.Clear();
            }
        }
Exemplo n.º 2
0
        public void OnTick()
        {
            CurrentDuel?.OnTick();

            foreach (KeyValuePair <ArenaDuel, DateTime> kvp in PendingDuels)
            {
                if (kvp.Value < DateTime.UtcNow)
                {
                    _Remove.Add(kvp.Key);
                }
            }

            if (_Remove.Count > 0)
            {
                for (var index = 0; index < _Remove.Count; index++)
                {
                    ArenaDuel duel = _Remove[index];

                    if (PendingDuels.ContainsKey(duel))
                    {
                        PendingDuels.Remove(duel);
                    }
                }

                _Remove.Clear();
            }
        }
Exemplo n.º 3
0
        public void Serialize(GenericWriter writer)
        {
            writer.Write(1);

            writer.Write(SurvivalRankings.Count);
            for (var index = 0; index < SurvivalRankings.Count; index++)
            {
                ArenaStats ranking = SurvivalRankings[index];
                ranking.Serialize(writer);
            }

            writer.Write(TeamRankings.Count);
            for (var index = 0; index < TeamRankings.Count; index++)
            {
                ArenaStats ranking = TeamRankings[index];
                ranking.Serialize(writer);
            }

            writer.Write(Blockers.Count);
            for (var index = 0; index < Blockers.Count; index++)
            {
                Item blocker = Blockers[index];
                writer.Write(blocker);
            }

            writer.Write(Stone);
            writer.Write(Manager);
            writer.Write(Banner1);
            writer.Write(Banner2);

            writer.Write(PendingDuels.Count);
            foreach (KeyValuePair <ArenaDuel, DateTime> kvp in PendingDuels)
            {
                kvp.Key.Serialize(writer);
                writer.WriteDeltaTime(kvp.Value);
            }

            writer.Write(BookedDuels.Count);
            for (var index = 0; index < BookedDuels.Count; index++)
            {
                ArenaDuel duel = BookedDuels[index];
                duel.Serialize(writer);
            }

            if (CurrentDuel != null)
            {
                writer.Write(1);
                CurrentDuel.Serialize(writer);
            }
            else
            {
                writer.Write(0);
            }
        }
Exemplo n.º 4
0
        public void Serialize(GenericWriter writer)
        {
            writer.Write(1);

            writer.Write(SurvivalRankings.Count);
            foreach (ArenaStats ranking in SurvivalRankings)
            {
                ranking.Serialize(writer);
            }

            writer.Write(TeamRankings.Count);
            foreach (ArenaStats ranking in TeamRankings)
            {
                ranking.Serialize(writer);
            }

            writer.Write(Blockers.Count);
            foreach (Item blocker in Blockers)
            {
                writer.Write(blocker);
            }

            writer.Write(Stone);
            writer.Write(Manager);
            writer.Write(Banner1);
            writer.Write(Banner2);

            writer.Write(PendingDuels.Count);
            foreach (KeyValuePair <ArenaDuel, DateTime> kvp in PendingDuels)
            {
                kvp.Key.Serialize(writer);
                writer.WriteDeltaTime(kvp.Value);
            }

            writer.Write(BookedDuels.Count);
            foreach (ArenaDuel duel in BookedDuels)
            {
                duel.Serialize(writer);
            }

            if (CurrentDuel != null)
            {
                writer.Write(1);
                CurrentDuel.Serialize(writer);
            }
            else
            {
                writer.Write(0);
            }
        }