Ejemplo n.º 1
0
        public GameStepCollection(BinaryReader br)
        {
            if ((SC_Message)br.ReadByte() != SC_Message.GameStepCollection)
            {
                throw new Exception("Expecte Message type SC_GameStepCollection");
            }

            var numGameSteps = br.ReadByte();

            GameSteps = new List <GameStep>();
            for (int i = 0; i < numGameSteps; i++)
            {
                var gameStep = new GameStep(br);
                GameSteps.Add(gameStep);
            }
        }
Ejemplo n.º 2
0
        public void Add(GameStep step)
        {
            _gameSteps[step.StepNumber] = step;

            if (_gameSteps.Count > _size)
            {
                while (true)
                {
                    if (_gameSteps.ContainsKey(_min))
                    {
                        _gameSteps.Remove(_min++);
                        break;
                    }
                    else
                    {
                        _min++;
                    }
                }
            }
        }
Ejemplo n.º 3
0
 public bool TryGet(UInt16 stepNumber, out GameStep ret)
 {
     return(_gameSteps.TryGetValue(stepNumber, out ret));
 }