Exemplo n.º 1
0
 /// <summary>
 /// Adds the given component to this GameState.
 /// </summary>
 public void AddComponent(GameStateComponent Component)
 {
     if (_Components.Contains(Component))
     {
         throw new ArgumentException("Component was already part of this GameState.");
     }
     this._Components.Add(Component);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Removes the specified component from this collection.
        /// </summary>
        public void RemoveComponent(GameStateComponent Component)
        {
            bool result = this._Components.Remove(Component);

            if (!result)
            {
                throw new ArgumentException("Component was not in this GameState.");
            }
        }