reordering and etc.

This commit is contained in:
SergoDobro 2023-08-14 11:25:16 +03:00
parent 0e1cb691b2
commit 1b19433645
9 changed files with 62 additions and 25 deletions

View file

@ -6,6 +6,7 @@ namespace DangerousD.GameCore
{ {
class GameObject class GameObject
{ {
GraphicsComponent graphicsComponent;
public GameObject() public GameObject()
{ {
GameManager.Register(this); GameManager.Register(this);

View file

@ -1,4 +1,5 @@
using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
@ -7,5 +8,7 @@ namespace DangerousD.GameCore
{ {
class GraphicsComponent class GraphicsComponent
{ {
public void Draw(SpriteBatch s
) { }
} }
} }

View file

@ -1,4 +1,5 @@
using System; using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
@ -6,5 +7,6 @@ namespace DangerousD.GameCore
{ {
class NetworkManager class NetworkManager
{ {
public void SendSOund(string sound, Vector2 soundPosition) { }
} }
} }

View 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() { }
}
}

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

View file

@ -1,10 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DangerousD.GameCore
{
class SoundManager
{
}
}

View file

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