C# PROGRAMMING
Start Code/Class Model/Mazegame/Mazegame.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 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
Start Code/Class Model/Mazegame/Mazegame.v11.suo
Start Code/Class Model/Mazegame/Mazegame/App.config
Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.exe
Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.exe.config
Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.pdb
Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.vshost.exe
Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.vshost.exe.config
Start Code/Class Model/Mazegame/Mazegame/bin/Debug/Mazegame.vshost.exe.manifest
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); }//end IMazeClient }//end namespace Boundary
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
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: Gsimmons /////////////////////////////////////////////////////////// using System; using Mazegame.Boundary; using Mazegame.Entity; namespace Mazegame.Control { public class DungeonMaster { public IMazeClient gameClient; public IMazeData gameData; public Player thePlayer; public DungeonMaster(IMazeData gameData, IMazeClient gameClient) { this.gameData = gameData; this.gameClient = gameClient; } 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); gameClient.PlayerMessage("Welcome " + playerName + "\n\n"); gameClient.PlayerMessage("You find yourself looking at "); gameClient.PlayerMessage(gameData.GetStartingLocation().Description); gameClient.GetReply("<<Hit Enter to exit>>"); } public void RunGame() { PrintWelcome(); SetupPlayer(); } } //end DungeonMaster } //end namespace Control
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
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
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
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
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
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
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 String Description{ get{return description;} set{description = value;} } public String Label { get { return label; } set { label = value; } } }//end Location }//end namespace Entity
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
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
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
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 { public Mazegame.Entity.Location m_Location; public Player() { } public Player(String name) : base(name) { } }//end Player }//end namespace Entity
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
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
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
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
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
Start Code/Class Model/Mazegame/Mazegame/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
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
Start Code/Class Model/Mazegame/Mazegame/obj/Debug/Mazegame.exe
Start Code/Class Model/Mazegame/Mazegame/obj/Debug/Mazegame.pdb
Start Code/Class Model/Mazegame/Mazegame/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
Start Code/Class Model/Mazegame/Mazegame/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
Start Code/Class Model/Mazegame/Mazegame/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
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(); } } }
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")]
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; } /// /// <param name="question"></param> public String GetReply(String question){ Console.Out.Write("\n" + question + " "); return Console.In.ReadLine(); } /// /// <param name="message"></param> public void PlayerMessage(String message){ Console.Out.Write(message); } }//end SimpleConsoleClient }//end namespace Mazegame
Start Code/Class Model/Mazegame/MazegameTest/bin/Debug/MazegameTest.dll
Start Code/Class Model/Mazegame/MazegameTest/bin/Debug/MazegameTest.pdb
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 False False False False
Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
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
Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/MazegameTest.dll
Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/MazegameTest.pdb
Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
Start Code/Class Model/Mazegame/MazegameTest/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
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")]
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() { } } }