diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/war-of-katan/war-of-katan.sln b/war-of-katan/war-of-katan.sln new file mode 100644 index 0000000..06e7757 --- /dev/null +++ b/war-of-katan/war-of-katan.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "war-of-katan", "war-of-katan\war-of-katan.csproj", "{95E995D5-7CB5-4A95-B37E-8AEEFF3964F2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {95E995D5-7CB5-4A95-B37E-8AEEFF3964F2}.Debug|x86.ActiveCfg = Debug|x86 + {95E995D5-7CB5-4A95-B37E-8AEEFF3964F2}.Debug|x86.Build.0 = Debug|x86 + {95E995D5-7CB5-4A95-B37E-8AEEFF3964F2}.Release|x86.ActiveCfg = Release|x86 + {95E995D5-7CB5-4A95-B37E-8AEEFF3964F2}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/war-of-katan/war-of-katan/Content/Content.mgcb b/war-of-katan/war-of-katan/Content/Content.mgcb new file mode 100644 index 0000000..ccb6d33 --- /dev/null +++ b/war-of-katan/war-of-katan/Content/Content.mgcb @@ -0,0 +1,15 @@ + +#----------------------------- Global Properties ----------------------------# + +/outputDir:bin/Windows +/intermediateDir:obj/Windows +/platform:Windows +/config: +/profile:Reach +/compress:False + +#-------------------------------- References --------------------------------# + + +#---------------------------------- Content ---------------------------------# + diff --git a/war-of-katan/war-of-katan/Game1.cs b/war-of-katan/war-of-katan/Game1.cs new file mode 100644 index 0000000..5b2d185 --- /dev/null +++ b/war-of-katan/war-of-katan/Game1.cs @@ -0,0 +1,83 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; + +namespace Katan +{ + /// + /// This is the main type for your game. + /// + public class Game1 : Game + { + GraphicsDeviceManager graphics; + SpriteBatch spriteBatch; + + public Game1() + { + graphics = new GraphicsDeviceManager(this); + Content.RootDirectory = "Content"; + } + + /// + /// Allows the game to perform any initialization it needs to before starting to run. + /// This is where it can query for any required services and load any non-graphic + /// related content. Calling base.Initialize will enumerate through any components + /// and initialize them as well. + /// + protected override void Initialize() + { + // TODO: Add your initialization logic here + + base.Initialize(); + } + + /// + /// LoadContent will be called once per game and is the place to load + /// all of your content. + /// + protected override void LoadContent() + { + // Create a new SpriteBatch, which can be used to draw textures. + spriteBatch = new SpriteBatch(GraphicsDevice); + + // TODO: use this.Content to load your game content here + } + + /// + /// UnloadContent will be called once per game and is the place to unload + /// game-specific content. + /// + protected override void UnloadContent() + { + // TODO: Unload any non ContentManager content here + } + + /// + /// Allows the game to run logic such as updating the world, + /// checking for collisions, gathering input, and playing audio. + /// + /// Provides a snapshot of timing values. + protected override void Update(GameTime gameTime) + { + if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) + Exit(); + + // TODO: Add your update logic here + + base.Update(gameTime); + } + + /// + /// This is called when the game should draw itself. + /// + /// Provides a snapshot of timing values. + protected override void Draw(GameTime gameTime) + { + GraphicsDevice.Clear(Color.CornflowerBlue); + + // TODO: Add your drawing code here + + base.Draw(gameTime); + } + } +} diff --git a/war-of-katan/war-of-katan/ISuspendable.cs b/war-of-katan/war-of-katan/ISuspendable.cs new file mode 100644 index 0000000..90c8b5a --- /dev/null +++ b/war-of-katan/war-of-katan/ISuspendable.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Katan +{ + namespace Graphics + { + interface ISuspendable + { + void Suspend(); + void Resume(); + } + } +} diff --git a/war-of-katan/war-of-katan/Icon.ico b/war-of-katan/war-of-katan/Icon.ico new file mode 100644 index 0000000..7d9dec1 Binary files /dev/null and b/war-of-katan/war-of-katan/Icon.ico differ diff --git a/war-of-katan/war-of-katan/MainMenuScreen.cs b/war-of-katan/war-of-katan/MainMenuScreen.cs new file mode 100644 index 0000000..285962c --- /dev/null +++ b/war-of-katan/war-of-katan/MainMenuScreen.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Katan.Graphics; + +namespace Katan +{ + namespace Screens + { + class MainMenuScreen : Screen + { + /// + /// Creates and instance of the MainMenu object. + /// + public MainMenuScreen() + { + + } + /// + /// Loads all needed content for the MainMenuScreen object. + /// + public override void LoadContent() + { + base.LoadContent(); + } + /// + /// Updates the Screen object. + /// + public override void Update() + { + base.Update(); + } + /// + /// Draws the Screen object. + /// + public override void Draw() + { + base.Draw(); + } + /// + /// Unloads the Screen object from memory. + /// + public override void UnloadContent() + { + base.UnloadContent(); + } + } + } +} diff --git a/war-of-katan/war-of-katan/Program.cs b/war-of-katan/war-of-katan/Program.cs new file mode 100644 index 0000000..89163d3 --- /dev/null +++ b/war-of-katan/war-of-katan/Program.cs @@ -0,0 +1,22 @@ +using System; + +namespace Katan +{ +#if WINDOWS || LINUX + /// + /// The main class. + /// + public static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + using (var game = new Game1()) + game.Run(); + } + } +#endif +} diff --git a/war-of-katan/war-of-katan/Properties/AssemblyInfo.cs b/war-of-katan/war-of-katan/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6b159d0 --- /dev/null +++ b/war-of-katan/war-of-katan/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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("war-of-katan")] +[assembly: AssemblyProduct("war-of-katan")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[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("c5345625-1135-4eb3-984a-b87d67c3d45f")] + +// 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("3.5.0.1260")] +[assembly: AssemblyFileVersion("3.5.0.1260")] diff --git a/war-of-katan/war-of-katan/Screen.cs b/war-of-katan/war-of-katan/Screen.cs new file mode 100644 index 0000000..29d7280 --- /dev/null +++ b/war-of-katan/war-of-katan/Screen.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Katan +{ + namespace Graphics + { + class Screen + { + protected bool loaded; + /// + /// Default constructor for Screen object. + /// + public Screen() + { + loaded = false; + } + /// + /// Loads all content needed for Screen object instance. + /// + public virtual void LoadContent() + { + loaded = true; + } + /// + /// Runs any logic needed for any components within the Screen object container. + /// + public virtual void Update() + { + if(!loaded) + { + throw new ScreenNotLoadedException(); + } + } + /// + /// Draws all components of the Screen object to the active graphics object. + /// + public virtual void Draw() + { + if (!loaded) + { + throw new ScreenNotLoadedException(); + } + } + /// + /// Frees all unneeded resources before deleting the Screen object. + /// + public virtual void UnloadContent() + { + loaded = false; + } + public bool IsLoaded() + { + return loaded; + } + } + class ScreenNotLoadedException : Exception + { + public ScreenNotLoadedException() + { + + } + } + class ScreenNotFoundException : Exception + { + public ScreenNotFoundException() + { + + } + } + } +} diff --git a/war-of-katan/war-of-katan/ScreenManager.cs b/war-of-katan/war-of-katan/ScreenManager.cs new file mode 100644 index 0000000..056d686 --- /dev/null +++ b/war-of-katan/war-of-katan/ScreenManager.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Katan.Graphics; + +namespace Katan +{ + namespace Graphics + { + class ScreenManager + { + private Dictionary screenList; + private string currentScreen; + + /// + /// Default constructor for ScreenManager object. + /// + public ScreenManager() + { + + } + /// + /// Runs update method for currently selected Screen object. + /// + public void Update() + { + + } + /// + /// Runs draw method for currently selected Screen object. + /// + public void Draw() + { + + } + /// + /// Adds a Screen object to private screen collection. + /// + /// Name of screen. + /// Screen object to add. + public void AddScreen(string _name, Screen _screen) + { + screenList.Add(_name, _screen); + } + public void SwitchScreen(string _name) + { + // Check to see if screen exists + if (!screenList.ContainsKey(_name)) + { + throw new ScreenNotFoundException(); + } + // Check if there is already an active screen + if (currentScreen != "") + { + // There is a screen already taking up memory, unload it + unloadScreen(_name); + } + // Load the new screen + + } + /// + /// Unloads a Screen object from memory. + /// + /// Name of Screen object to unload. + private void unloadScreen(string _name) + { + if (screenList[currentScreen] is ISuspendable) + { + (screenList[currentScreen] as ISuspendable).Suspend(); + } + else + { + screenList[currentScreen].UnloadContent(); + } + } + /// + /// Loads a Screen object into memory. + /// + /// Name of Screen object to load. + private void loadScreen(string _name) + { + if (screenList[currentScreen] is ISuspendable) + { + (screenList[currentScreen] as ISuspendable).Resume(); + } + else + { + screenList[currentScreen].LoadContent(); + } + } + } + } +} diff --git a/war-of-katan/war-of-katan/war-of-katan.csproj b/war-of-katan/war-of-katan/war-of-katan.csproj new file mode 100644 index 0000000..77c715c --- /dev/null +++ b/war-of-katan/war-of-katan/war-of-katan.csproj @@ -0,0 +1,73 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {95E995D5-7CB5-4A95-B37E-8AEEFF3964F2} + WinExe + Properties + war_of_katan + war-of-katan + 512 + Windows + + + $(MSBuildProgramFiles32) + $(MSBuildExtensionsPath) + + + x86 + true + full + false + bin\Windows\Debug\ + DEBUG;TRACE;WINDOWS + prompt + 4 + + + x86 + pdbonly + true + bin\Windows\Release\ + TRACE;WINDOWS + prompt + 4 + + + Icon.ico + + + + + + + + + + + + + $(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\Windows\MonoGame.Framework.dll + + + + + + + + + + + + + + \ No newline at end of file