private void PrintInstructions() { using (new ColorContext(ColorContext.InstructionsColor)) { ColorContext.PrintWithKeyCodes("Please enter [N]orth, [S]outh, [E]ast or [W]est to move around,\n"); ColorContext.PrintWithKeyCodes("[L] to look around, [P] to pick up an item, [I] for Inventory, [B] for Battle,\n"); ColorContext.PrintWithKeyCodes("[C] to view stats, or [M] to print the map. [U] is to use items,\n"); ColorContext.PrintWithKeyCodes("[T] to talk to someone, or [Q] qommit suicide to exit the game.\n\n"); } }
public void PrintItems <T>(List <T> items) where T : BaseObject { for (int i = 0; i < items.Count; i++) { var item = items[i]; using (new ColorContext(item.Color)) { ColorContext.PrintWithKeyCodes($"[{i + 1}] {item.Name} {item.Description}\n"); } } Console.WriteLine(); }
/// <summary> /// Returns a string containing all the characters in the room /// </summary> /// <returns>A description of the characters in the room</returns> public void PrintNPCs() { if (NPCsInRoom.Count == 0) { using (new ColorContext(ColorContext.FailureColor)) { Console.WriteLine("There's no one here."); } } for (int i = 0; i < NPCsInRoom.Count; i++) { string formattedName = NPCsInRoom[i].Name.Replace('_', ' '); ColorContext.PrintWithKeyCodes($"[{i+1}] {formattedName} : {NPCsInRoom[i].Description}\n"); } Console.WriteLine(); }