Exemplo n.º 1
0
        public void MovePlayerTo(Room room)
        {
            Room real = room;

            if (!IsLit())
            {
                room = Rooms.Get <Darkness>();
            }

            Story.Location = room;

            if (!room.Visited && room.Initial != null)
            {
                room.Initial();
            }
            else
            {
                if (!IsLit() && room.Visited)
                {
                    real.DarkToDark();
                }
                Look(false);
            }


            room.Visited = true;

            Story.Location = real;
        }
Exemplo n.º 2
0
        private void Move(Room room)
        {
            Room nextRoom = room;

            if (!CurrentRoom.IsLit() && !room.Light)
            {
                room = Rooms.Get <Darkness>();
            }

            Context.Story.Location = room;

            if (!room.Visited)
            {
                CurrentRoom.Look(true);

                room.Initial?.Invoke();
            }
            else
            {
                if (!CurrentRoom.IsLit() && room.Visited)
                {
                    nextRoom.DarkToDark();
                }

                CurrentRoom.Look(false);
            }


            room.Visited = true;

            Context.Story.Location = nextRoom;
        }
Exemplo n.º 3
0
        private void AddToRoomMap <T>(string direction) where T : Room
        {
            Room room = Rooms.Get <T>();

            if (room != null)
            {
                roomMap.Add(direction, () => room);
            }
        }
Exemplo n.º 4
0
        public void Look(bool showFull)
        {
            PrintLine();

            Room room = IsLit() ? Location : Rooms.Get <Darkness>();

            Bold(room.Name);

            if (showFull || !Location.Visited)
            {
                Print(room.Description);
            }

            DisplayRoomObjects();
        }
Exemplo n.º 5
0
        public static void Look(bool showFull)
        {
            Context.Output.PrintLine();

            Room room = IsLit() ? Context.Story.Location : Rooms.Get <Darkness>();

            Context.Output.Bold(room.Name);

            if (showFull || !Location.Visited)
            {
                Print(room.Description);
            }

            DisplayRoomObjects();
        }
Exemplo n.º 6
0
        public static void Look(bool showFull)
        {
            // look is special in that it uses extra formatting like bold,
            // so this is sent directly to the console

            Output.PrintLine();

            Room room = IsLit() ? Location : Rooms.Get <Darkness>();

            Output.Bold(room.Name);

            if (showFull || !Location.Visited)
            {
                Output.Print(room.Description);
            }

            DisplayRoomObjects();
        }
Exemplo n.º 7
0
 protected Room Room <T>()
 {
     return(Rooms.Get <T>());
 }
Exemplo n.º 8
0
        protected bool In <T>() where T : Object
        {
            Object obj = Rooms.Get <T>();

            return(L.CurrentLocation == obj);
        }
Exemplo n.º 9
0
        public void MovePlayerTo <T>() where T : Room
        {
            var room = Rooms.Get <T>();

            MovePlayerTo(room);
        }