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; }
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; }
private void AddToRoomMap <T>(string direction) where T : Room { Room room = Rooms.Get <T>(); if (room != null) { roomMap.Add(direction, () => room); } }
public void Look(bool showFull) { PrintLine(); Room room = IsLit() ? Location : Rooms.Get <Darkness>(); Bold(room.Name); if (showFull || !Location.Visited) { Print(room.Description); } DisplayRoomObjects(); }
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(); }
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(); }
protected Room Room <T>() { return(Rooms.Get <T>()); }
protected bool In <T>() where T : Object { Object obj = Rooms.Get <T>(); return(L.CurrentLocation == obj); }
public void MovePlayerTo <T>() where T : Room { var room = Rooms.Get <T>(); MovePlayerTo(room); }