Skip to content

Commit

Permalink
Base MonoGame app
Browse files Browse the repository at this point in the history
  • Loading branch information
ARMmaster17 committed Jan 29, 2016
1 parent a6a8f30 commit 49b1c8a
Show file tree
Hide file tree
Showing 12 changed files with 548 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
22 changes: 22 additions & 0 deletions war-of-katan/war-of-katan.sln
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions war-of-katan/war-of-katan/Content/Content.mgcb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

#----------------------------- Global Properties ----------------------------#

/outputDir:bin/Windows
/intermediateDir:obj/Windows
/platform:Windows
/config:
/profile:Reach
/compress:False

#-------------------------------- References --------------------------------#


#---------------------------------- Content ---------------------------------#

83 changes: 83 additions & 0 deletions war-of-katan/war-of-katan/Game1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace Katan
{
/// <summary>
/// This is the main type for your game.
/// </summary>
public class Game1 : Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;

public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}

/// <summary>
/// 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.
/// </summary>
protected override void Initialize()
{
// TODO: Add your initialization logic here

base.Initialize();
}

/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
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
}

/// <summary>
/// UnloadContent will be called once per game and is the place to unload
/// game-specific content.
/// </summary>
protected override void UnloadContent()
{
// TODO: Unload any non ContentManager content here
}

/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
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);
}

/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);

// TODO: Add your drawing code here

base.Draw(gameTime);
}
}
}
16 changes: 16 additions & 0 deletions war-of-katan/war-of-katan/ISuspendable.cs
Original file line number Diff line number Diff line change
@@ -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();
}
}
}
Binary file added war-of-katan/war-of-katan/Icon.ico
Binary file not shown.
50 changes: 50 additions & 0 deletions war-of-katan/war-of-katan/MainMenuScreen.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// Creates and instance of the MainMenu object.
/// </summary>
public MainMenuScreen()
{

}
/// <summary>
/// Loads all needed content for the MainMenuScreen object.
/// </summary>
public override void LoadContent()
{
base.LoadContent();
}
/// <summary>
/// Updates the Screen object.
/// </summary>
public override void Update()
{
base.Update();
}
/// <summary>
/// Draws the Screen object.
/// </summary>
public override void Draw()
{
base.Draw();
}
/// <summary>
/// Unloads the Screen object from memory.
/// </summary>
public override void UnloadContent()
{
base.UnloadContent();
}
}
}
}
22 changes: 22 additions & 0 deletions war-of-katan/war-of-katan/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;

namespace Katan
{
#if WINDOWS || LINUX
/// <summary>
/// The main class.
/// </summary>
public static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
using (var game = new Game1())
game.Run();
}
}
#endif
}
36 changes: 36 additions & 0 deletions war-of-katan/war-of-katan/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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")]
74 changes: 74 additions & 0 deletions war-of-katan/war-of-katan/Screen.cs
Original file line number Diff line number Diff line change
@@ -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;
/// <summary>
/// Default constructor for Screen object.
/// </summary>
public Screen()
{
loaded = false;
}
/// <summary>
/// Loads all content needed for Screen object instance.
/// </summary>
public virtual void LoadContent()
{
loaded = true;
}
/// <summary>
/// Runs any logic needed for any components within the Screen object container.
/// </summary>
public virtual void Update()
{
if(!loaded)
{
throw new ScreenNotLoadedException();
}
}
/// <summary>
/// Draws all components of the Screen object to the active graphics object.
/// </summary>
public virtual void Draw()
{
if (!loaded)
{
throw new ScreenNotLoadedException();
}
}
/// <summary>
/// Frees all unneeded resources before deleting the Screen object.
/// </summary>
public virtual void UnloadContent()
{
loaded = false;
}
public bool IsLoaded()
{
return loaded;
}
}
class ScreenNotLoadedException : Exception
{
public ScreenNotLoadedException()
{

}
}
class ScreenNotFoundException : Exception
{
public ScreenNotFoundException()
{

}
}
}
}
Loading

0 comments on commit 49b1c8a

Please sign in to comment.