void removeFromRoom(DogDescriptor dog, PPScene room) { List <DogDescriptor> inRoom; if (WorldDogs.TryGetValue(room, out inRoom)) { inRoom.Remove(dog); } }
void addDogToRoom(DogDescriptor dog, PPScene room) { List <DogDescriptor> inRoom; if (!WorldDogs.TryGetValue(room, out inRoom)) { inRoom = new List <DogDescriptor>(); WorldDogs.Add(room, inRoom); } inRoom.Add(dog); }
public DogDescriptor[] DogsInRoom(PPScene room) { List <DogDescriptor> inRoom; if (WorldDogs.TryGetValue(room, out inRoom)) { return(inRoom.ToArray()); } else { return(new DogDescriptor[NONE_VALUE]); } }