C# PROGRAMMING
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 VisualStudioVersion = 12.0.21005.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mazegame", "Mazegame\Mazegame.csproj", "{9E228483-14B2-40A3-8F30-61F7E04DB26B}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MazegameTest", "MazegameTest\MazegameTest.csproj", "{033188F2-BD5E-4FB2-833A-693B79B8933D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {9E228483-14B2-40A3-8F30-61F7E04DB26B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9E228483-14B2-40A3-8F30-61F7E04DB26B}.Debug|Any CPU.Build.0 = Debug|Any CPU {9E228483-14B2-40A3-8F30-61F7E04DB26B}.Release|Any CPU.ActiveCfg = Release|Any CPU {9E228483-14B2-40A3-8F30-61F7E04DB26B}.Release|Any CPU.Build.0 = Release|Any CPU {033188F2-BD5E-4FB2-833A-693B79B8933D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {033188F2-BD5E-4FB2-833A-693B79B8933D}.Debug|Any CPU.Build.0 = Debug|Any CPU {033188F2-BD5E-4FB2-833A-693B79B8933D}.Release|Any CPU.ActiveCfg = Release|Any CPU {033188F2-BD5E-4FB2-833A-693B79B8933D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame.v11.suo
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame.v12.suo
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame.zip
Mazegame/App.config
Mazegame/bin/Debug/Mazegame.exe
Mazegame/bin/Debug/Mazegame.exe.config
Mazegame/bin/Debug/Mazegame.pdb
Mazegame/bin/Debug/Mazegame.vshost.exe
Mazegame/bin/Debug/Mazegame.vshost.exe.config
Mazegame/bin/Debug/Mazegame.vshost.exe.manifest
Mazegame/Boundary/IMazeClient.cs
/////////////////////////////////////////////////////////// // IMazeClient.cs // Implementation of the Interface IMazeClient // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; namespace Mazegame.Boundary { public interface IMazeClient { /// /// <param name="question"></param> String GetReply(String question); /// /// <param name="message"></param> void PlayerMessage(String message); String GetCommand(); }//end IMazeClient }//end namespace Boundary
Mazegame/Boundary/IMazeData.cs
/////////////////////////////////////////////////////////// // IMazeData.cs // Implementation of the Interface IMazeData // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; using Mazegame.Entity; namespace Mazegame.Boundary { public interface IMazeData { Location GetStartingLocation(); String GetWelcomeMessage(); }//end IMazeData }//end namespace Boundary
Mazegame/Control/Command.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Mazegame.Entity; namespace Mazegame.Control { public abstract class Command { public abstract CommandResponse Execute(ParsedInput userInput, Player thePlayer); } }
Mazegame/Control/CommandHandler.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mazegame.Control { public class CommandHandler { private Hashtable availableCommands; private Parser theParser; public CommandHandler() { availableCommands = new Hashtable(); SetupCommands(); theParser = new Parser(new ArrayList(availableCommands.Keys)); } private void SetupCommands() { availableCommands.Add("go", new MoveCommand()); availableCommands.Add("quit", new QuitCommand()); availableCommands.Add("move", new MoveCommand()); } public CommandResponse ProcessTurn(String userInput, Player thePlayer) { ParsedInput validInput = theParser.Parse(userInput); try { Command theCommand = (Command)availableCommands[validInput.Command]; return theCommand.Execute(validInput, thePlayer); } catch (KeyNotFoundException) { return new CommandResponse("Not a valid command"); } } } }
Mazegame/Control/CommandResponse.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mazegame.Control { public class CommandResponse { private bool finishedGame; private string message; public CommandResponse(string message) { Message = message; FinishedGame = false; } public CommandResponse(string message, bool quitFlag) { Message = message; FinishedGame = quitFlag; } public bool FinishedGame { get { return finishedGame; } set { finishedGame = value; } } public string Message { get { return message; } set { message = value; } } } }
Mazegame/Control/DungeonMaster.cs
/////////////////////////////////////////////////////////// // DungeonMaster.cs // Implementation of the Class DungeonMaster // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:36 PM // Original author: Eburuo Raymond Emeka // Group Members: Eburuo Raymond Emeka and Babita Tamang /////////////////////////////////////////////////////////// using System; using Mazegame.Boundary; using Mazegame.Entity; using Mazegame; using System.Collections; namespace Mazegame.Control { public class DungeonMaster { private IMazeClient gameClient; private IMazeData gameData; private Player thePlayer; private CommandHandler playerTurnHandler; public DungeonMaster(IMazeData gameData, IMazeClient gameClient) { this.gameData = gameData; this.gameClient = gameClient; playerTurnHandler = new CommandHandler(); } public void PrintWelcome() { gameClient.PlayerMessage(gameData.GetWelcomeMessage()); } public void SetupPlayer() { String playerName = gameClient.GetReply("What name do you choose to be known by?"); thePlayer = new Player(playerName); thePlayer.CurrentLocation = gameData.GetStartingLocation(); gameClient.PlayerMessage("Welcome " + playerName + "\n\n"); gameClient.PlayerMessage("You find yourself looking at "); gameClient.PlayerMessage(thePlayer.CurrentLocation.Description); } public void RunGame() { PrintWelcome(); SetupPlayer(); while (handlePlayerTurn()) { // handle npc logic later here } gameClient.GetReply("\n\n<<Hit enter to exit>>"); } private bool handlePlayerTurn() { CommandResponse playerResponse = playerTurnHandler.ProcessTurn(gameClient.GetCommand(), thePlayer); gameClient.PlayerMessage(playerResponse.Message); return !playerResponse.FinishedGame; } } //end DungeonMaster } //end namespace Control
Mazegame/Control/MoveCommand.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mazegame.Control { public class MoveCommand : Command { public override CommandResponse Execute(ParsedInput userInput, Player thePlayer) { if (userInput.Arguments.Count == 0) { return new CommandResponse("If you want to move you need to tell me where"); } String exitLabel = (String)userInput.Arguments[0]; Exit desiredExit = thePlayer.CurrentLocation.GetExit(exitLabel); if (desiredExit == null) { return new CommandResponse("There is no exit there.. Trying moving someplace moveable!!"); } thePlayer.CurrentLocation = desiredExit.Destination; return new CommandResponse("You find yourself looking at " + thePlayer.CurrentLocation.Description); } } }
Mazegame/Control/ParsedInput.cs
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mazegame.Control { public class ParsedInput { private string command; private ArrayList arguments; public ParsedInput() { arguments = new ArrayList(); command = ""; } public ParsedInput(string command, ArrayList arguments) { this.command = command; this.arguments = arguments; } public string Command { get { return command; } set { command = value; } } public ArrayList Arguments { get { return arguments; } set { arguments = value; } } } }
Mazegame/Control/Parser.cs
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mazegame.Control { public class Parser { private ArrayList dropWords; private ArrayList validCommands; public Parser(ArrayList validCommands) { dropWords = new ArrayList(new string[]{"in","an","and", "the","this", "to"}); this.validCommands = validCommands; } public ParsedInput Parse(String rawInput) { ParsedInput parsedInput = new ParsedInput(); String lowercaseInput = rawInput.ToLower(); ArrayList stringTokens = new ArrayList(lowercaseInput.Split()); foreach (string token in stringTokens) { if (validCommands.Contains(token)) { parsedInput.Command = token; } else if (!dropWords.Contains(token)) parsedInput.Arguments.Add(token); } return parsedInput; } } }
Mazegame/Control/QuitCommand.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mazegame.Control { public class QuitCommand : Command { public override CommandResponse Execute(ParsedInput userInput, Player thePlayer) { return new CommandResponse("Thanks for playing -- Goodbye",true); } } }
Mazegame/Entity/Armor.cs
/////////////////////////////////////////////////////////// // Armor.cs // Implementation of the Class Armor // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:36 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// namespace Mazegame.Entity { public class Armor : Item { private int bonus; public Armor() { } public int Bonus { get { return bonus; } set { bonus = value; } } } //end Armor } //end namespace Entity
Mazegame/Entity/Blacksmith.cs
/////////////////////////////////////////////////////////// // Blacksmith.cs // Implementation of the Class Blacksmith // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:36 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// namespace Mazegame.Entity { public class Blacksmith : Shop { public Blacksmith(){ } }//end Blacksmith }//end namespace Entity
Mazegame/Entity/Character.cs
/////////////////////////////////////////////////////////// // Character.cs // Implementation of the Class Character // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:36 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; namespace Mazegame.Entity { public class Character { private int agility; private int lifePoints; private String name; private int strength; public Mazegame.Entity.Dice m_Dice; public Mazegame.Entity.Party m_Party; public Mazegame.Entity.Item m_Item; public Mazegame.Entity.Shield m_Shield; public Mazegame.Entity.Weapon m_Weapon; public Mazegame.Entity.Armor m_Armor; public Character() { } public Character(String name) { Name = name; } public int Agility { get { return agility; } set { agility = value; } } public int LifePoints { get { return lifePoints; } set { lifePoints = value; } } public String Name { get { return name; } set { name = value; } } public int Strength { get { return strength; } set { strength = value; } } } //end Character } //end namespace Entity
Mazegame/Entity/Dice.cs
/////////////////////////////////////////////////////////// // Dice.cs // Implementation of the Class Dice // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:36 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// namespace Mazegame.Entity { public class Dice { private int rolls; private int sides; public Dice() { } public int Rolls { get { return rolls; } set { rolls = value; } } public int Sides { get { return sides; } set { sides = value; } } } //end Dice } //end namespace Entity
Mazegame/Entity/Exit.cs
/////////////////////////////////////////////////////////// // Exit.cs // Implementation of the Class Exit // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; namespace Mazegame.Entity { public class Exit { private String description; private Mazegame.Entity.Location destination; public Exit(String description, Location destination) { Description = description; Destination = destination; } public string Description { get { return description; } set { description = value; } } public Location Destination { get { return destination; } set { destination = value; } } }//end Exit }//end namespace Entity
Mazegame/Entity/Item.cs
/////////////////////////////////////////////////////////// // Item.cs // Implementation of the Class Item // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; namespace Mazegame.Entity { public class Item { private int worth; private int weight; private String description; public int Worth { get { return worth; } set { worth = value; } } public int Weight { get { return weight; } set { weight = value; } } public string Description { get { return description; } set { description = value; } } } //end Item } //end namespace Entity
Mazegame/Entity/Location.cs
/////////////////////////////////////////////////////////// // Location.cs // Implementation of the Class Location // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; using System.Collections; namespace Mazegame.Entity { public class Location { private Hashtable exits; private String description; private String label; public Location() { } public Location(String description, String label) { Description = description; Label = label; exits = new Hashtable(); } public Boolean AddExit(String exitLabel, Exit theExit) { if (exits.ContainsKey(exitLabel)) return false; exits.Add(exitLabel, theExit); return true; } public Exit GetExit(String exitLabel) { return (Exit)exits[exitLabel]; } public String Description { get { return description; } set { description = value; } } public String Label { get { return label; } set { label = value; } } } }
Mazegame/Entity/Maze.cs
/////////////////////////////////////////////////////////// // Maze.cs // Implementation of the Class Maze // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// namespace Mazegame.Entity { public class Maze { public Mazegame.Entity.Location m_Location; public Maze(){ } }//end Maze }//end namespace Entity
Mazegame/Entity/NonPlayerCharacter.cs
/////////////////////////////////////////////////////////// // NonPlayerCharacter.cs // Implementation of the Class NonPlayerCharacter // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; namespace Mazegame.Entity { public class NonPlayerCharacter : Character { private Boolean hostile; public NonPlayerCharacter() { } public Boolean Hostile { get { return hostile; } set { hostile = value; } } } //end NonPlayerCharacter } //end namespace Entity
Mazegame/Entity/Party.cs
/////////////////////////////////////////////////////////// // Party.cs // Implementation of the Class Party // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; namespace Mazegame.Entity { public class Party { private Boolean moveable; public Mazegame.Entity.Location m_Location; public Mazegame.Entity.Character m_Character; public Party() { } public Boolean Moveable { get { return moveable; } set { moveable = value; } } } //end Party } //end namespace Entity
Mazegame/Entity/Player.cs
/////////////////////////////////////////////////////////// // Player.cs // Implementation of the Class Player // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; namespace Mazegame.Entity { public class Player : Character { private Location currentLocation; public Player() { } public Player(String name) : base(name) { } public Location CurrentLocation { get { return currentLocation; } set { currentLocation = value; } } } }
Mazegame/Entity/Shield.cs
/////////////////////////////////////////////////////////// // Shield.cs // Implementation of the Class Shield // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// namespace Mazegame.Entity { public class Shield : Armor { public Shield(){ } }//end Shield }//end namespace Entity
Mazegame/Entity/Shop.cs
/////////////////////////////////////////////////////////// // Shop.cs // Implementation of the Class Shop // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// namespace Mazegame.Entity { public class Shop : Location { public Shop(){ } }//end Shop }//end namespace Entity
Mazegame/Entity/Weapon.cs
/////////////////////////////////////////////////////////// // Weapon.cs // Implementation of the Class Weapon // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// namespace Mazegame.Entity { public class Weapon : Item { public Mazegame.Entity.Dice m_Dice; public Weapon(){ } }//end Weapon }//end namespace Entity
Mazegame/HardCodedData.cs
/////////////////////////////////////////////////////////// // HardCodedData.cs // Implementation of the Class HardCodedData // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; using Mazegame.Boundary; using Mazegame.Entity; namespace Mazegame { public class HardCodedData : IMazeData { private Location startUp; public HardCodedData() { createLocations(); } ~HardCodedData() { } public virtual void Dispose() { } public Location GetStartingLocation() { return startUp; } public String GetWelcomeMessage() { return "Welcome to the Mount Helanous"; } private void createLocations() { startUp = new Location("an office with paper strewn everywhere, how anyone works effectively here is a mystery", "Julies Office"); Location lounge = new Location("an open space containing comfortable looking couches and artwork of dubious quality", "Airport Lounge"); Location t127 = new Location("a lecture theatre", "T127"); Location gregsoffice = new Location("a spinning vortex of terror", "Greg's Office"); startUp.AddExit("south", new Exit("you see an open space to the south", lounge)); lounge.AddExit("north", new Exit("you see a mound of paper to the north", startUp)); startUp.AddExit("west", new Exit("you see a terrifying office to the west", gregsoffice)); gregsoffice.AddExit("east", new Exit("you see a mound of paper to the east", startUp)); t127.AddExit("south", new Exit("you see a mound of paper to the south", startUp)); startUp.AddExit("north", new Exit("you see a bleak place to the north", t127)); lounge.AddExit("northwest", new Exit("you see a terrifying office to the northwest", gregsoffice)); gregsoffice.AddExit("southeast", new Exit("you see an open space to the southeast", lounge)); } } //end HardCodedData } //end namespace Mazegame
Mazegame/Lab_07.csproj
Debug AnyCPU {9E228483-14B2-40A3-8F30-61F7E04DB26B} Exe Properties Mazegame Mazegame v4.5 512 AnyCPU true full false bin\Debug\ DEBUG;TRACE prompt 4 AnyCPU pdbonly true bin\Release\ TRACE prompt 4
Mazegame/Mazegame.csproj
Debug AnyCPU {9E228483-14B2-40A3-8F30-61F7E04DB26B} Exe Properties Mazegame Mazegame v4.5 512 AnyCPU true full false bin\Debug\ DEBUG;TRACE prompt 4 AnyCPU pdbonly true bin\Release\ TRACE prompt 4
Mazegame/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Mazegame/obj/Debug/Mazegame.csproj.FileListAbsolute.txt
C:\Users\gsimmons\Desktop\ITECH3201-7201 Semester 1 2014\Lecture 7\Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe.config C:\Users\gsimmons\Desktop\ITECH3201-7201 Semester 1 2014\Lecture 7\Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe C:\Users\gsimmons\Desktop\ITECH3201-7201 Semester 1 2014\Lecture 7\Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.pdb C:\Users\gsimmons\Desktop\ITECH3201-7201 Semester 1 2014\Lecture 7\Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.exe C:\Users\gsimmons\Desktop\ITECH3201-7201 Semester 1 2014\Lecture 7\Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.pdb C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe.config C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.pdb C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.exe C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.pdb C:\Users\A30311085\Desktop\Jatin_Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe.config C:\Users\A30311085\Desktop\Jatin_Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.exe C:\Users\A30311085\Desktop\Jatin_Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.pdb C:\Users\A30311085\Desktop\Jatin_Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe C:\Users\A30311085\Desktop\Jatin_Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.pdb C:\Users\A30311085\Desktop\Jatin_Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.csprojResolveAssemblyReference.cache C:\Users\a30322291\Desktop\Lab07\Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe.config C:\Users\a30322291\Desktop\Lab07\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.exe C:\Users\a30322291\Desktop\Lab07\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.pdb E:\Lab07\Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe.config E:\Lab07\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.exe E:\Lab07\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.pdb E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe.config E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.exe E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.pdb E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.pdb E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.csprojResolveAssemblyReference.cache C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe.config C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.exe C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.pdb C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.csprojResolveAssemblyReference.cache
Mazegame/obj/Debug/Mazegame.csprojResolveAssemblyReference.cache
Mazegame/obj/Debug/Mazegame.exe
Mazegame/obj/Debug/Mazegame.pdb
Mazegame/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
Mazegame/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
Mazegame/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
Mazegame/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Mazegame.Control; namespace Mazegame { class Program { static void Main(string[] args) { DungeonMaster theDm = new DungeonMaster(new HardCodedData(), new SimpleConsoleClient()); theDm.RunGame(); } } }
Mazegame/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Mazegame")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("University of Ballarat")] [assembly: AssemblyProduct("Mazegame")] [assembly: AssemblyCopyright("Copyright © University of Ballarat 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("06cda7d3-9d43-4e3c-9daa-44558caac2c9")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
Mazegame/SimpleConsoleClient.cs
/////////////////////////////////////////////////////////// // SimpleConsoleClient.cs // Implementation of the Class SimpleConsoleClient // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; using Mazegame.Boundary; namespace Mazegame { public class SimpleConsoleClient : IMazeClient { public SimpleConsoleClient(){ Console.Title = "Greg's wacky maze game"; Console.WindowWidth = 100; Console.ForegroundColor = ConsoleColor.White; } /// public String GetReply(String question){ Console.Out.Write("\n" + question + " "); return Console.In.ReadLine(); } public void PlayerMessage(String message){ Console.Out.Write(message); } public String GetCommand() { Console.Out.Write("\n\n>>> "); return Console.In.ReadLine(); } }//end SimpleConsoleClient }//end namespace Mazegame
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/App.config
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.exe
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.exe.config
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.pdb
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.vshost.exe
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.vshost.exe.config
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.vshost.exe.manifest
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Boundary/IMazeClient.cs
/////////////////////////////////////////////////////////// // IMazeClient.cs // Implementation of the Interface IMazeClient // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; namespace Mazegame.Boundary { public interface IMazeClient { /// /// <param name="question"></param> String GetReply(String question); /// /// <param name="message"></param> void PlayerMessage(String message); String GetCommand(); }//end IMazeClient }//end namespace Boundary
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Boundary/IMazeData.cs
/////////////////////////////////////////////////////////// // IMazeData.cs // Implementation of the Interface IMazeData // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; using Mazegame.Entity; namespace Mazegame.Boundary { public interface IMazeData { Location GetStartingLocation(); String GetWelcomeMessage(); }//end IMazeData }//end namespace Boundary
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Control/Command.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Mazegame.Entity; namespace Mazegame.Control { public abstract class Command { public abstract CommandResponse Execute(ParsedInput userInput, Player thePlayer); } }
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Control/CommandHandler.cs
using Mazegame.Entity; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mazegame.Control { public class CommandHandler { private Hashtable availableCommands; private Parser theParser; public CommandHandler() { availableCommands = new Hashtable(); SetupCommands(); theParser = new Parser(new ArrayList(availableCommands.Keys)); } private void SetupCommands() { availableCommands.Add("go", new MoveCommand()); availableCommands.Add("quit", new QuitCommand()); availableCommands.Add("move", new MoveCommand()); availableCommands.Add("look", new LookCommand()); } public CommandResponse ProcessTurn(String userInput, Player thePlayer) { ParsedInput validInput = theParser.Parse(userInput); try { Command theCommand = (Command)availableCommands[validInput.Command]; return theCommand.Execute(validInput, thePlayer); } catch (KeyNotFoundException) { return new CommandResponse("Not a valid command"); } } } }
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Control/CommandResponse.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mazegame.Control { public class CommandResponse { private bool finishedGame; private string message; public CommandResponse(string message) { Message = message; FinishedGame = false; } public CommandResponse(string message, bool quitFlag) { Message = message; FinishedGame = quitFlag; } public bool FinishedGame { get { return finishedGame; } set { finishedGame = value; } } public string Message { get { return message; } set { message = value; } } } }
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Control/DungeonMaster.cs
/////////////////////////////////////////////////////////// // DungeonMaster.cs // Implementation of the Class DungeonMaster // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:36 PM // Original author: Eburuo Raymond Emeka // Group Members: Eburuo Raymond Emeka and Babita Tamang /////////////////////////////////////////////////////////// using System; using Mazegame.Boundary; using Mazegame.Entity; using Mazegame; using System.Collections; namespace Mazegame.Control { public class DungeonMaster { private IMazeClient gameClient; private IMazeData gameData; private Player thePlayer; private CommandHandler playerTurnHandler; public DungeonMaster(IMazeData gameData, IMazeClient gameClient) { this.gameData = gameData; this.gameClient = gameClient; playerTurnHandler = new CommandHandler(); } public void PrintWelcome() { gameClient.PlayerMessage(gameData.GetWelcomeMessage()); } public void SetupPlayer() { String playerName = gameClient.GetReply("What name do you choose to be known by?"); thePlayer = new Player(playerName); thePlayer.CurrentLocation = gameData.GetStartingLocation(); gameClient.PlayerMessage("Welcome " + playerName + "\n\n"); gameClient.PlayerMessage("You find yourself looking at "); gameClient.PlayerMessage(thePlayer.CurrentLocation.Description); } public void RunGame() { PrintWelcome(); SetupPlayer(); while (handlePlayerTurn()) { // handle npc logic later here } gameClient.GetReply("\n\n<<Hit enter to exit>>"); } private bool handlePlayerTurn() { CommandResponse playerResponse = playerTurnHandler.ProcessTurn(gameClient.GetCommand(), thePlayer); gameClient.PlayerMessage(playerResponse.Message); return !playerResponse.FinishedGame; } } //end DungeonMaster } //end namespace Control
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Control/LookCommand.cs
using Mazegame.Entity; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mazegame.Control { public class LookCommand : Command { private CommandResponse response; public override CommandResponse Execute(ParsedInput userInput, Player thePlayer) { response = new CommandResponse("Can't find that to look at here!"); if (userInput.Arguments.Count == 0) { response.Message = thePlayer.CurrentLocation.ToString(); return response; } foreach (string argument in userInput.Arguments) { if (thePlayer.CurrentLocation.ContainsExit(argument)) { Exit theExit = thePlayer.CurrentLocation.GetExit(argument); return new CommandResponse(theExit.Description); } } return response; } } }
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Control/MoveCommand.cs
using Mazegame.Entity; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mazegame.Control { public class MoveCommand : Command { public override CommandResponse Execute(ParsedInput userInput, Player thePlayer) { if (userInput.Arguments.Count == 0) { return new CommandResponse("If you want to move you need to tell me where"); } String exitLabel = (String)userInput.Arguments[0]; Exit desiredExit = thePlayer.CurrentLocation.GetExit(exitLabel); if (desiredExit == null) { return new CommandResponse("There is no exit there.. Trying moving someplace moveable!!"); } thePlayer.CurrentLocation = desiredExit.Destination; return new CommandResponse("You successfully move " + exitLabel + " and find yourself somewhere else\n\n" + thePlayer.CurrentLocation.ToString()); } } }
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Control/ParsedInput.cs
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mazegame.Control { public class ParsedInput { private string command; private ArrayList arguments; public ParsedInput() { arguments = new ArrayList(); command = ""; } public ParsedInput(string command, ArrayList arguments) { this.command = command; this.arguments = arguments; } public string Command { get { return command; } set { command = value; } } public ArrayList Arguments { get { return arguments; } set { arguments = value; } } } }
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Control/Parser.cs
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mazegame.Control { public class Parser { private ArrayList dropWords; private ArrayList validCommands; public Parser(ArrayList validCommands) { dropWords = new ArrayList(new string[]{"in","an","and", "the","this", "to"}); this.validCommands = validCommands; } public ParsedInput Parse(String rawInput) { ParsedInput parsedInput = new ParsedInput(); String lowercaseInput = rawInput.ToLower(); ArrayList stringTokens = new ArrayList(lowercaseInput.Split()); foreach (string token in stringTokens) { if (validCommands.Contains(token)) { parsedInput.Command = token; } else if (!dropWords.Contains(token)) parsedInput.Arguments.Add(token); } return parsedInput; } } }
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Control/QuitCommand.cs
using Mazegame.Entity; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mazegame.Control { public class QuitCommand : Command { public override CommandResponse Execute(ParsedInput userInput, Player thePlayer) { return new CommandResponse("Thanks for playing -- Goodbye", true); } } }
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Entity/Armor.cs
/////////////////////////////////////////////////////////// // Armor.cs // Implementation of the Class Armor // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:36 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// namespace Mazegame.Entity { public class Armor : Item { private int bonus; public Armor() { } public int Bonus { get { return bonus; } set { bonus = value; } } } //end Armor } //end namespace Entity
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Entity/Blacksmith.cs
/////////////////////////////////////////////////////////// // Blacksmith.cs // Implementation of the Class Blacksmith // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:36 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// namespace Mazegame.Entity { public class Blacksmith : Shop { public Blacksmith(){ } }//end Blacksmith }//end namespace Entity
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Entity/Character.cs
/////////////////////////////////////////////////////////// // Character.cs // Implementation of the Class Character // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:36 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; namespace Mazegame.Entity { public class Character { private int agility; private int lifePoints; private String name; private int strength; public Mazegame.Entity.Dice m_Dice; public Mazegame.Entity.Party m_Party; public Mazegame.Entity.Item m_Item; public Mazegame.Entity.Shield m_Shield; public Mazegame.Entity.Weapon m_Weapon; public Mazegame.Entity.Armor m_Armor; public Character() { } public Character(String name) { Name = name; } public int Agility { get { return agility; } set { agility = value; } } public int LifePoints { get { return lifePoints; } set { lifePoints = value; } } public String Name { get { return name; } set { name = value; } } public int Strength { get { return strength; } set { strength = value; } } } //end Character } //end namespace Entity
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Entity/Dice.cs
/////////////////////////////////////////////////////////// // Dice.cs // Implementation of the Class Dice // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:36 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// namespace Mazegame.Entity { public class Dice { private int rolls; private int sides; public Dice() { } public int Rolls { get { return rolls; } set { rolls = value; } } public int Sides { get { return sides; } set { sides = value; } } } //end Dice } //end namespace Entity
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Entity/Exit.cs
/////////////////////////////////////////////////////////// // Exit.cs // Implementation of the Class Exit // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; namespace Mazegame.Entity { public class Exit { private String description; private Mazegame.Entity.Location destination; public Exit(String description, Location destination) { Description = description; Destination = destination; } public string Description { get { return description; } set { description = value; } } public Location Destination { get { return destination; } set { destination = value; } } }//end Exit }//end namespace Entity
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Entity/Item.cs
/////////////////////////////////////////////////////////// // Item.cs // Implementation of the Class Item // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; namespace Mazegame.Entity { public class Item { private int worth; private int weight; private String description; public int Worth { get { return worth; } set { worth = value; } } public int Weight { get { return weight; } set { weight = value; } } public string Description { get { return description; } set { description = value; } } } //end Item } //end namespace Entity
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Entity/Location.cs
/////////////////////////////////////////////////////////// // Location.cs // Implementation of the Class Location // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; using System.Collections; using System.Text; namespace Mazegame.Entity { public class Location { private Hashtable exits; private String description; private String label; public Location() { } public Location(String description, String label) { Description = description; Label = label; exits = new Hashtable(); } public Boolean AddExit(String exitLabel, Exit theExit) { if (exits.ContainsKey(exitLabel)) return false; exits.Add(exitLabel, theExit); return true; } public Exit GetExit(String exitLabel) { return (Exit)exits[exitLabel]; } public String Description { get { return description; } set { description = value; } } public String Label { get { return label; } set { label = value; } } public String AvailableExits() { StringBuilder returnMsg = new StringBuilder(); foreach (string label in this.exits.Keys) { returnMsg.Append("[" + label + "] "); } return returnMsg.ToString(); } public bool ContainsExit(String exitLabel) { return exits.Contains(exitLabel); } public override string ToString() { return "**********\n" + this.Label + "\n**********\n" + "Exits found :: " + AvailableExits() + "\n**********\n" + this.Description + "\n**********\n"; } } }
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Entity/Maze.cs
/////////////////////////////////////////////////////////// // Maze.cs // Implementation of the Class Maze // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// namespace Mazegame.Entity { public class Maze { public Mazegame.Entity.Location m_Location; public Maze(){ } }//end Maze }//end namespace Entity
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Entity/NonPlayerCharacter.cs
/////////////////////////////////////////////////////////// // NonPlayerCharacter.cs // Implementation of the Class NonPlayerCharacter // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; namespace Mazegame.Entity { public class NonPlayerCharacter : Character { private Boolean hostile; public NonPlayerCharacter() { } public Boolean Hostile { get { return hostile; } set { hostile = value; } } } //end NonPlayerCharacter } //end namespace Entity
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Entity/Party.cs
/////////////////////////////////////////////////////////// // Party.cs // Implementation of the Class Party // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; namespace Mazegame.Entity { public class Party { private Boolean moveable; public Mazegame.Entity.Location m_Location; public Mazegame.Entity.Character m_Character; public Party() { } public Boolean Moveable { get { return moveable; } set { moveable = value; } } } //end Party } //end namespace Entity
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Entity/Player.cs
/////////////////////////////////////////////////////////// // Player.cs // Implementation of the Class Player // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; namespace Mazegame.Entity { public class Player : Character { private Location currentLocation; public Player() { } public Player(String name) : base(name) { } public Location CurrentLocation { get { return currentLocation; } set { currentLocation = value; } } } }
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Entity/Shield.cs
/////////////////////////////////////////////////////////// // Shield.cs // Implementation of the Class Shield // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// namespace Mazegame.Entity { public class Shield : Armor { public Shield(){ } }//end Shield }//end namespace Entity
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Entity/Shop.cs
/////////////////////////////////////////////////////////// // Shop.cs // Implementation of the Class Shop // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// namespace Mazegame.Entity { public class Shop : Location { public Shop(){ } }//end Shop }//end namespace Entity
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Entity/Weapon.cs
/////////////////////////////////////////////////////////// // Weapon.cs // Implementation of the Class Weapon // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// namespace Mazegame.Entity { public class Weapon : Item { public Mazegame.Entity.Dice m_Dice; public Weapon(){ } }//end Weapon }//end namespace Entity
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/HardCodedData.cs
/////////////////////////////////////////////////////////// // HardCodedData.cs // Implementation of the Class HardCodedData // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; using Mazegame.Boundary; using Mazegame.Entity; namespace Mazegame { public class HardCodedData : IMazeData { private Location startUp; public HardCodedData() { createLocations(); } ~HardCodedData() { } public virtual void Dispose() { } public Location GetStartingLocation() { return startUp; } public String GetWelcomeMessage() { return "Welcome to the Mount Helanous"; } private void createLocations() { startUp = new Location("an office with paper strewn everywhere, how anyone works effectively here is a mystery", "Julies Office"); Location lounge = new Location("an open space containing comfortable looking couches and artwork of dubious quality", "Airport Lounge"); Location t127 = new Location("a lecture theatre", "T127"); Location gregsoffice = new Location("a spinning vortex of terror", "Greg's Office"); startUp.AddExit("south", new Exit("you see an open space to the south", lounge)); lounge.AddExit("north", new Exit("you see a mound of paper to the north", startUp)); startUp.AddExit("west", new Exit("you see a terrifying office to the west", gregsoffice)); gregsoffice.AddExit("east", new Exit("you see a mound of paper to the east", startUp)); t127.AddExit("south", new Exit("you see a mound of paper to the south", startUp)); startUp.AddExit("north", new Exit("you see a bleak place to the north", t127)); lounge.AddExit("northwest", new Exit("you see a terrifying office to the northwest", gregsoffice)); gregsoffice.AddExit("southeast", new Exit("you see an open space to the southeast", lounge)); } } //end HardCodedData } //end namespace Mazegame
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Lab_07.csproj
Debug AnyCPU {9E228483-14B2-40A3-8F30-61F7E04DB26B} Exe Properties Mazegame Mazegame v4.5 512 AnyCPU true full false bin\Debug\ DEBUG;TRACE prompt 4 AnyCPU pdbonly true bin\Release\ TRACE prompt 4
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Mazegame.csproj
Debug AnyCPU {9E228483-14B2-40A3-8F30-61F7E04DB26B} Exe Properties Mazegame Mazegame v4.5 512 AnyCPU true full false bin\Debug\ DEBUG;TRACE prompt 4 AnyCPU pdbonly true bin\Release\ TRACE prompt 4
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/obj/Debug/Mazegame.csproj.FileListAbsolute.txt
C:\Users\gsimmons\Desktop\ITECH3201-7201 Semester 1 2014\Lecture 7\Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe.config C:\Users\gsimmons\Desktop\ITECH3201-7201 Semester 1 2014\Lecture 7\Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe C:\Users\gsimmons\Desktop\ITECH3201-7201 Semester 1 2014\Lecture 7\Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.pdb C:\Users\gsimmons\Desktop\ITECH3201-7201 Semester 1 2014\Lecture 7\Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.exe C:\Users\gsimmons\Desktop\ITECH3201-7201 Semester 1 2014\Lecture 7\Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.pdb C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe.config C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.pdb C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.exe C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.pdb C:\Users\A30311085\Desktop\Jatin_Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe.config C:\Users\A30311085\Desktop\Jatin_Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.exe C:\Users\A30311085\Desktop\Jatin_Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.pdb C:\Users\A30311085\Desktop\Jatin_Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe C:\Users\A30311085\Desktop\Jatin_Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.pdb C:\Users\A30311085\Desktop\Jatin_Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.csprojResolveAssemblyReference.cache C:\Users\a30322291\Desktop\Lab07\Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe.config C:\Users\a30322291\Desktop\Lab07\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.exe C:\Users\a30322291\Desktop\Lab07\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.pdb E:\Lab07\Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe.config E:\Lab07\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.exe E:\Lab07\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.pdb E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe.config E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.exe E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.pdb E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.pdb E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.csprojResolveAssemblyReference.cache C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe.config C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.exe C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.pdb C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\Mazegame\obj\Debug\Mazegame.csprojResolveAssemblyReference.cache C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.exe C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\Mazegame\bin\Debug\Mazegame.pdb
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/obj/Debug/Mazegame.csprojResolveAssemblyReference.cache
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/obj/Debug/Mazegame.exe
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/obj/Debug/Mazegame.pdb
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Mazegame.Control; namespace Mazegame { class Program { static void Main(string[] args) { DungeonMaster theDm = new DungeonMaster(new HardCodedData(), new SimpleConsoleClient()); theDm.RunGame(); } } }
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Mazegame")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("University of Ballarat")] [assembly: AssemblyProduct("Mazegame")] [assembly: AssemblyCopyright("Copyright © University of Ballarat 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("06cda7d3-9d43-4e3c-9daa-44558caac2c9")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/SimpleConsoleClient.cs
/////////////////////////////////////////////////////////// // SimpleConsoleClient.cs // Implementation of the Class SimpleConsoleClient // Generated by Enterprise Architect // Created on: 28-Apr-2014 10:13:37 PM // Original author: Gsimmons /////////////////////////////////////////////////////////// using System; using Mazegame.Boundary; namespace Mazegame { public class SimpleConsoleClient : IMazeClient { public SimpleConsoleClient(){ Console.Title = "Greg's wacky maze game"; Console.WindowWidth = 100; Console.ForegroundColor = ConsoleColor.White; } /// public String GetReply(String question){ Console.Out.Write("\n" + question + " "); return Console.In.ReadLine(); } public void PlayerMessage(String message){ Console.Out.Write(message); } public String GetCommand() { Console.Out.Write("\n\n>>> "); return Console.In.ReadLine(); } }//end SimpleConsoleClient }//end namespace Mazegame
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/bin/Debug/Mazegame.exe
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/bin/Debug/Mazegame.pdb
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/bin/Debug/MazegameTest.dll
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/bin/Debug/MazegameTest.pdb
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/LocationTest.cs
using System; using System.Text; using System.Collections.Generic; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace MazegameTest { [TestClass] public class LocationTest { private Mazegame.Entity.Location t127; private Mazegame.Entity.Location gregsoffice; [TestInitialize] public void init() { t127 = new Mazegame.Entity.Location("a lecture theatre", "T127"); gregsoffice = new Mazegame.Entity.Location("a spinning vortex of terror", "Greg's Office"); } [TestMethod] public void TestAddExit() { // add some exits should return true Assert.IsTrue(t127.AddExit("south", new Mazegame.Entity.Exit("you see a mound of paper to the south", gregsoffice))); Assert.IsTrue(gregsoffice.AddExit("north", new Mazegame.Entity.Exit("you see a bleak place to the north", t127))); //should already have an exit south so cant add another one Assert.IsFalse(t127.AddExit("south", new Mazegame.Entity.Exit("desc", gregsoffice))); } [TestMethod] public void TestGetExit() { Mazegame.Entity.Exit myExit = new Mazegame.Entity.Exit("you see a mound of paper to the south", gregsoffice); t127.AddExit("south", myExit); Assert.AreSame(myExit, t127.GetExit("south")); Assert.IsNull(t127.GetExit("north")); } } }
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/LookCommandTest.cs
using System; using System.Collections; using Mazegame.Control; using Mazegame.Entity; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace MazegameTest { [TestClass] public class LookCommandTest { private ParsedInput playerInput; private Player thePlayer; private CommandHandler handler; private LookCommand look; private Exit southExit; private Location t127; [TestInitialize] public void Init() { playerInput = new ParsedInput("look", new ArrayList()); thePlayer = new Player("greg"); t127 = new Location("a lecture theatre", "T127"); Location gregsoffice = new Location("a spinning vortex of terror", "Greg's Office"); southExit = new Exit("you see a mound of paper to the south", gregsoffice); t127.AddExit("south", southExit); thePlayer.CurrentLocation = t127; handler = new CommandHandler(); look = new LookCommand(); } [TestMethod] public void TestLookNowhere() { Assert.AreSame(t127, thePlayer.CurrentLocation); // test move command no arguments CommandResponse response = look.Execute(playerInput, thePlayer); Assert.IsFalse(response.FinishedGame); Assert.IsTrue(response.Message.Contains(t127.Description)); } [TestMethod] public void TestLookNoMatch() { playerInput.Arguments = new ArrayList(new string[] { "bunyip" }); CommandResponse response = look.Execute(playerInput, thePlayer); Assert.IsFalse(response.FinishedGame); Assert.IsTrue(response.Message.Contains("Can't find that")); } [TestMethod] public void TestLookExit() { playerInput.Arguments = new ArrayList(new string[] { "south" }); CommandResponse response = look.Execute(playerInput, thePlayer); Assert.IsFalse(response.FinishedGame); Assert.IsTrue(response.Message.Contains(southExit.Description)); } [TestMethod] public void TestMoveHandler() { // test move command no arguments CommandResponse response = handler.ProcessTurn("look to the south", thePlayer); Assert.IsFalse(response.FinishedGame); Assert.IsTrue(response.Message.Contains(southExit.Description)); } } }
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/MazegameTest.csproj
Debug AnyCPU {033188F2-BD5E-4FB2-833A-693B79B8933D} Library Properties MazegameTest MazegameTest v4.5 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages False UnitTest true full false bin\Debug\ DEBUG;TRACE prompt 4 pdbonly true bin\Release\ TRACE prompt 4 {9e228483-14b2-40a3-8f30-61f7e04db26b} Mazegame False False False False
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/MoveCommandTest.cs
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using Mazegame.Control; using Mazegame.Entity; using System.Collections; namespace MazegameTest { [TestClass] public class MoveCommandTest { private ParsedInput playerInput; private Player thePlayer; private CommandHandler handler; private MoveCommand move; private Location t127; private Location gregsoffice; [TestInitialize] public void Init() { playerInput = new ParsedInput("move", new ArrayList()); thePlayer = new Player("greg"); t127 = new Location("a lecture theatre", "T127"); gregsoffice = new Location("a spinning vortex of terror", "Greg's Office"); t127.AddExit("south", new Exit("you see a mound of paper to the south", gregsoffice)); gregsoffice.AddExit("north", new Exit("you see a bleak place to the north", t127)); thePlayer.CurrentLocation = t127; handler = new CommandHandler(); move = new MoveCommand(); } [TestMethod] public void TestMoveNowhere() { Assert.AreSame(t127, thePlayer.CurrentLocation); // test move command no arguments CommandResponse response = move.Execute(playerInput, thePlayer); Assert.IsFalse(response.FinishedGame); Assert.IsTrue(response.Message.Contains("tell me where")); Assert.AreSame(t127, thePlayer.CurrentLocation); } [TestMethod] public void TestMoveNoExit() { playerInput.Arguments = new ArrayList(new string[] { "west" }); CommandResponse response = move.Execute(playerInput, thePlayer); Assert.IsFalse(response.FinishedGame); Assert.IsTrue(response.Message.Contains("no exit there")); Assert.AreSame(t127, thePlayer.CurrentLocation); } [TestMethod] public void TestTakeExit() { playerInput.Arguments = new ArrayList(new string[] { "south" }); CommandResponse response = move.Execute(playerInput, thePlayer); Assert.IsFalse(response.FinishedGame); Assert.IsTrue(response.Message.Contains(gregsoffice.Description)); Assert.AreSame(gregsoffice, thePlayer.CurrentLocation); } [TestMethod] public void TestMoveHandler() { // test move command no arguments CommandResponse response = handler.ProcessTurn("move to the south", thePlayer); Assert.IsFalse(response.FinishedGame); Assert.IsTrue(response.Message.Contains(gregsoffice.Description)); Assert.AreSame(gregsoffice, thePlayer.CurrentLocation); } } }
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/MazegameTest.csproj.FileListAbsolute.txt
C:\Users\gsimmons\Desktop\ITECH3201-7201 Semester 1 2014\Lecture 7\Code\Class Model\Mazegame\MazegameTest\bin\Debug\MazegameTest.dll C:\Users\gsimmons\Desktop\ITECH3201-7201 Semester 1 2014\Lecture 7\Code\Class Model\Mazegame\MazegameTest\bin\Debug\MazegameTest.pdb C:\Users\gsimmons\Desktop\ITECH3201-7201 Semester 1 2014\Lecture 7\Code\Class Model\Mazegame\MazegameTest\obj\Debug\MazegameTest.dll C:\Users\gsimmons\Desktop\ITECH3201-7201 Semester 1 2014\Lecture 7\Code\Class Model\Mazegame\MazegameTest\obj\Debug\MazegameTest.pdb C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\MazegameTest\bin\Debug\MazegameTest.dll C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\MazegameTest\bin\Debug\MazegameTest.pdb C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\MazegameTest\bin\Debug\Mazegame.exe C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\MazegameTest\bin\Debug\Mazegame.pdb C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\MazegameTest\obj\Debug\MazegameTest.csprojResolveAssemblyReference.cache C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\MazegameTest\obj\Debug\MazegameTest.dll C:\Users\A30311085\Desktop\Lab7\Start Code\Class Model\Mazegame\MazegameTest\obj\Debug\MazegameTest.pdb E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\MazegameTest\bin\Debug\MazegameTest.dll E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\MazegameTest\bin\Debug\MazegameTest.pdb E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\MazegameTest\bin\Debug\Mazegame.exe E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\MazegameTest\bin\Debug\Mazegame.pdb E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\MazegameTest\obj\Debug\MazegameTest.csprojResolveAssemblyReference.cache E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\MazegameTest\obj\Debug\MazegameTest.dll E:\Lab07 - Copy\Lab07\Start Code\Class Model\Mazegame\MazegameTest\obj\Debug\MazegameTest.pdb C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\MazegameTest\obj\Debug\MazegameTest.csprojResolveAssemblyReference.cache C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\MazegameTest\obj\Debug\MazegameTest.dll C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\MazegameTest\obj\Debug\MazegameTest.pdb C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\MazegameTest\bin\Debug\MazegameTest.dll C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\MazegameTest\bin\Debug\MazegameTest.pdb C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\MazegameTest\bin\Debug\Mazegame.exe C:\Users\a30311652\Desktop\Lab07_ray\Lab07_ray\Lab07\Start Code\Class Model\Mazegame\MazegameTest\bin\Debug\Mazegame.pdb
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/MazegameTest.csprojResolveAssemblyReference.cache
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/MazegameTest.dll
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/MazegameTest.pdb
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/ParserTest.cs
using System; using System.Collections; using Mazegame.Control; using Microsoft.VisualStudio.TestTools.UnitTesting; using Mazegame; namespace MazegameTest { [TestClass] public class ParserTest { private ArrayList commands; private Parser theParser; [TestInitialize] public void Init() { commands = new ArrayList(new string[] { "quit", "move" }); theParser = new Parser(commands); } [TestMethod] public void TestCommandDetection() { ParsedInput userInput = theParser.Parse("quit"); Assert.AreEqual(userInput.Command, "quit"); userInput = theParser.Parse("move west"); Assert.AreEqual(userInput.Command, "move"); userInput = theParser.Parse("greg"); Assert.AreEqual(userInput.Command, ""); } [TestMethod] public void TestArgumentDetection() { ParsedInput userInput = theParser.Parse("quit"); Assert.IsTrue(userInput.Arguments.Count == 0); userInput = theParser.Parse("move west"); Assert.IsTrue(userInput.Arguments.Count == 1); userInput = theParser.Parse("move to the west"); Assert.IsTrue(userInput.Arguments.Count == 1); } } }
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("MazegameTest")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("University of Ballarat")] [assembly: AssemblyProduct("MazegameTest")] [assembly: AssemblyCopyright("Copyright © University of Ballarat 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("d8678ae7-f466-4180-98dc-b23a75781629")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
Lab 8/Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/QuitCommandTest.cs
using System; using System.Collections; using Mazegame.Control; using Mazegame.Entity; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace MazegameTest { [TestClass] public class QuitCommandTest { private ParsedInput playerInput; private Player thePlayer; private CommandHandler handler; private QuitCommand quit; [TestInitialize] public void Init() { playerInput = new ParsedInput("quit", new ArrayList()); thePlayer = new Player("greg"); handler = new CommandHandler(); quit = new QuitCommand(); } [TestMethod] public void TestQuit() { // test quit command no arguments CommandResponse response = quit.Execute(playerInput, thePlayer); Assert.IsTrue(response.FinishedGame); Assert.IsTrue(response.Message.Contains("Goodbye")); // test quit command >0 arguments playerInput.Arguments = new ArrayList(new string[] { "this", "game" }); response = quit.Execute(playerInput, thePlayer); Assert.IsTrue(response.FinishedGame); Assert.IsTrue(response.Message.Contains("Goodbye")); } [TestMethod] public void TestQuitHandler() { // test quit command no arguments CommandResponse response = handler.ProcessTurn("quit", thePlayer); Assert.IsTrue(response.FinishedGame); Assert.IsTrue(response.Message.Contains("Goodbye")); // test quit command >0 arguments response = handler.ProcessTurn("quit this game", thePlayer); Assert.IsTrue(response.FinishedGame); Assert.IsTrue(response.Message.Contains("Goodbye")); } } }