コード例 #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]);
        }
    }