public void UpdateSpaceship(Spaceship updatedSpaceship) { int id = updatedSpaceship.Id; if (Spaceships.ContainsKey(id)) { Spaceships[id] = updatedSpaceship; } }
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); }