예제 #1
0
    void removeFromRoom(DogDescriptor dog, PPScene room)
    {
        List <DogDescriptor> inRoom;

        if (WorldDogs.TryGetValue(room, out inRoom))
        {
            inRoom.Remove(dog);
        }
    }
예제 #2
0
    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);
    }
예제 #3
0
    public DogDescriptor[] DogsInRoom(PPScene room)
    {
        List <DogDescriptor> inRoom;

        if (WorldDogs.TryGetValue(room, out inRoom))
        {
            return(inRoom.ToArray());
        }
        else
        {
            return(new DogDescriptor[NONE_VALUE]);
        }
    }