Merge branch 'Collision' into Development
This commit is contained in:
commit
30d663b278
3 changed files with 21 additions and 28 deletions
|
@ -1,4 +1,5 @@
|
|||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Win32;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -12,29 +13,29 @@ namespace ZoFo.GameCore.GameManagers.CollisionManager
|
|||
{
|
||||
public class CollisionComponent
|
||||
{
|
||||
//==КОНСТРУКТОР==
|
||||
public CollisionComponent(GameObject gameObject)
|
||||
{
|
||||
this.gameObject = gameObject;
|
||||
AppManager.Instance.server.collisionManager.Register(this);
|
||||
}
|
||||
|
||||
|
||||
//==ПОЛЯ==
|
||||
|
||||
public GameObject gameObject { get; set; }
|
||||
//public Rectangle Bounds { get; set; }
|
||||
|
||||
//public Rectangle Rectangle => new Rectangle();
|
||||
|
||||
|
||||
|
||||
bool doesStop;
|
||||
bool hasCollision;
|
||||
public Rectangle stopRectangle;
|
||||
|
||||
// triggers for rectangle
|
||||
bool isTrigger;
|
||||
public Rectangle triggerRectanglee;
|
||||
public Rectangle triggerRectangle;
|
||||
|
||||
//delegate
|
||||
public delegate void EventHandler(object sender, EventArgs e);
|
||||
|
||||
//public CollisionComponent(int x, int y, int width, int height)
|
||||
//{
|
||||
// Bounds = new Rectangle(x, y, width, height);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
@ -42,25 +43,12 @@ namespace ZoFo.GameCore.GameManagers.CollisionManager
|
|||
public event EventHandler<CollisionComponent> OnTriggerEnter;
|
||||
public event EventHandler<CollisionComponent> OnTriggerZone;
|
||||
public event EventHandler<CollisionComponent> OnTriggerExit;
|
||||
|
||||
public event EventHandler<CollisionComponent> OnCollision;
|
||||
|
||||
public event EventHandler<CollisionComponent> OnTriggerInteract;
|
||||
|
||||
// methods-event
|
||||
public void TriggerEnter(object component, Player player,
|
||||
EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
public void TriggerZone(object component,Player player,
|
||||
EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
public void TriggerExit(object component,Player player,
|
||||
EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public CollisionComponent(GameObject gameObject)
|
||||
{
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZoFo.GameCore.GameObjects.Entities.LivingEntities;
|
||||
|
||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||
{
|
||||
|
|
|
@ -24,11 +24,15 @@ namespace ZoFo.GameCore
|
|||
{
|
||||
private ServerNetworkManager networkManager;
|
||||
private int ticks = 0;
|
||||
public IPEndPoint MyIp { get { return networkManager.InfoConnect; } }
|
||||
public IPEndPoint MyIp { get { return networkManager.InfoConnect; } }
|
||||
|
||||
public CollisionManager collisionManager;
|
||||
|
||||
public Server()
|
||||
{
|
||||
networkManager = new ServerNetworkManager();
|
||||
networkManager.GetDataSend += OnDataSend;
|
||||
collisionManager = new CollisionManager();
|
||||
|
||||
}
|
||||
#region server logic as App
|
||||
|
|
Loading…
Add table
Reference in a new issue