Esempio n. 1
0
 /// <summary>
 /// Gets the appropriate ConsoleText for a room object
 /// </summary>
 /// <param name="location">The room object to get the console text for</param>
 /// <returns>The console text for a room object</returns>
 private static ConsoleText GetItemConsoleText(ILocation location)
 {
     return(location switch
     {
         ISankaraStone _ => new ConsoleText("S", ConsoleColor.DarkYellow),
         IDisappearingTrap _ => new ConsoleText("@"),
         IBoobyTrap _ => new ConsoleText("Ο"),
         IKey key => new ConsoleText("K", Utils.Color.ColorToConsoleColor(key.Color)),
         IPressurePlate _ => new ConsoleText("T"),
         IIceTile _ => new ConsoleText("~", ConsoleColor.Blue),
         _ => new ConsoleText("?")
     });
Esempio n. 2
0
        private static ConsoleText GetItemConsoleText(IRoomObject roomObject)
        {
            return(roomObject switch
            {
                ISankaraStone _ => new ConsoleText("S", ConsoleColor.DarkYellow),
                IDisappearingTrap _ => new ConsoleText("@"),
                IBoobyTrap _ => new ConsoleText("Ο"),
                IKey key => new ConsoleText("K", key.Color),
                IPressurePlate _ => new ConsoleText("T"),
                IPortal _ => new ConsoleText("Π", ConsoleColor.Magenta),
                IConveyorBelt conveyorBelt => new ConsoleText(
                    Util.ConvertDirectionConveyorBeltIcon(conveyorBelt.Direction)),

                _ => new ConsoleText("?")
            });