C# PROGRAMMING

Raymond1985
CompletedcodeLab07_ray.zip

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

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame.v11.suo

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame.v12.suo

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/App.config

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.exe

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.exe.config

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.pdb

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.vshost.exe

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.vshost.exe.config

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.vshost.exe.manifest

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

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

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 bool continueGame; private ArrayList commands; private Parser theParser; public DungeonMaster(IMazeData gameData, IMazeClient gameClient) { this.gameData = gameData; this.gameClient = gameClient; continueGame = true; commands = new ArrayList(new string[] { "quit", "move" }); theParser = new Parser(commands); } 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 (continueGame) { continueGame = ProcessPlayerTurn(); } } public bool ProcessPlayerTurn() { ParsedInput userInput = theParser.Parse(gameClient.GetCommand()); //check if the user has entered a command we recognise if (commands.Contains(userInput.Command)) { if (userInput.Command.Equals("quit")) return false; if (userInput.Command.Equals("move")) { processMove(userInput); return true; } } gameClient.PlayerMessage("We don't recognise that command try again!"); return true; } private void processMove(ParsedInput userInput) { // exit is the first argument in the move command ie: move west String exitLabel = (String)userInput.Arguments[0]; Exit desiredExit = thePlayer.CurrentLocation.GetExit(exitLabel); if (desiredExit == null) { gameClient.PlayerMessage("There is no exit there.. Trying moving someplace moveable!!"); return; } thePlayer.CurrentLocation = desiredExit.Destination; gameClient.PlayerMessage("You find yourself looking at "); gameClient.PlayerMessage(thePlayer.CurrentLocation.Description); } } //end DungeonMaster }

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; } } } }

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; } } }

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

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

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

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

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

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

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; 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; } } } }

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

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

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

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; } } } }

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

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

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

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

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

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

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache

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

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/obj/Debug/Mazegame.csprojResolveAssemblyReference.cache

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/obj/Debug/Mazegame.exe

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/obj/Debug/Mazegame.pdb

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/Mazegame/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

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(); } } }

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")]

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

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/bin/Debug/Mazegame.exe

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/bin/Debug/Mazegame.pdb

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/bin/Debug/MazegameTest.dll

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/bin/Debug/MazegameTest.pdb

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")); } } }

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

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache

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

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/MazegameTest.csprojResolveAssemblyReference.cache

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/MazegameTest.dll

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/MazegameTest.pdb

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

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); } } }

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")]

Lab07_ray/Lab07/Start Code/Class Model/Mazegame/MazegameTest/UnitTest1.cs

using System; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace MazegameTest { [TestClass] public class UnitTest1 { [TestMethod] public void TestMethod1() { } } }