Пример #1
0
        public void UpdateSpaceship(Spaceship updatedSpaceship)
        {
            int id = updatedSpaceship.Id;

            if (Spaceships.ContainsKey(id))
            {
                Spaceships[id] = updatedSpaceship;
            }
        }
Пример #2
0
        public Object GetObjectById(int id)
        {
            Object returnObject;

            if (Spaceships.ContainsKey(id))
            {
                returnObject = Spaceships[id];
            }
            else if (Asteroids.ContainsKey(id))
            {
                returnObject = Asteroids[id];
            }
            else
            {
                returnObject = new Object();
            }

            return(returnObject);
        }