reordering and etc.
This commit is contained in:
parent
0e1cb691b2
commit
1b19433645
9 changed files with 62 additions and 25 deletions
|
@ -6,6 +6,7 @@ namespace DangerousD.GameCore
|
|||
{
|
||||
class GameObject
|
||||
{
|
||||
GraphicsComponent graphicsComponent;
|
||||
public GameObject()
|
||||
{
|
||||
GameManager.Register(this);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
@ -7,5 +8,7 @@ namespace DangerousD.GameCore
|
|||
{
|
||||
class GraphicsComponent
|
||||
{
|
||||
public void Draw(SpriteBatch s
|
||||
) { }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
|
@ -6,5 +7,6 @@ namespace DangerousD.GameCore
|
|||
{
|
||||
class NetworkManager
|
||||
{
|
||||
public void SendSOund(string sound, Vector2 soundPosition) { }
|
||||
}
|
||||
}
|
13
DangerousD/GameCore/Managers/SoundManager.cs
Normal file
13
DangerousD/GameCore/Managers/SoundManager.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace DangerousD.GameCore
|
||||
{
|
||||
class SoundManager
|
||||
{
|
||||
public void LoadSounds() { }
|
||||
public void StartSound(string soundName) { }//GameManager.SendSound
|
||||
public void StopAllSounds() { }
|
||||
}
|
||||
}
|
42
DangerousD/GameCore/Managers/TextureManager.cs
Normal file
42
DangerousD/GameCore/Managers/TextureManager.cs
Normal file
|
@ -0,0 +1,42 @@
|
|||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace DangerousD.GameCore
|
||||
{
|
||||
static class TextureManager
|
||||
{
|
||||
public static ContentManager contentManager;
|
||||
public static GraphicsDevice graphicsDevice;
|
||||
public static SpriteBatch spriteBatch;
|
||||
private static Dictionary<string, Texture2D> textures = new Dictionary<string, Texture2D>();
|
||||
public static Texture2D nullTexture;
|
||||
public static void Init(GraphicsDevice _graphicsDevice, ContentManager _contentManager, SpriteBatch _spriteBatch)
|
||||
{
|
||||
graphicsDevice = _graphicsDevice;
|
||||
contentManager = _contentManager;
|
||||
spriteBatch = _spriteBatch;
|
||||
nullTexture = new Texture2D(graphicsDevice, 1, 1);
|
||||
nullTexture.SetData(new Color[] { Color.Purple , Color.Black, Color.Purple, Color.Black });
|
||||
}
|
||||
public static Texture2D GetTexture(string textureName)
|
||||
{
|
||||
if (textures.ContainsKey(textureName))
|
||||
return textures[textureName];
|
||||
try
|
||||
{
|
||||
Texture2D loadedTexture = contentManager.Load<Texture2D>(textureName);
|
||||
textures.Add(textureName, loadedTexture);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return nullTexture;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace DangerousD.GameCore
|
||||
{
|
||||
class SoundManager
|
||||
{
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace DangerousD.GameCore
|
||||
{
|
||||
static class TextureManager
|
||||
{
|
||||
public static ContentManager contentManager;
|
||||
public static GraphicsDevice graphicsDevice;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue