commit
c4f34a6d8a
17 changed files with 113 additions and 10 deletions
|
@ -17,7 +17,10 @@ namespace ZoFo.GameCore.GameManagers.CollisionManager
|
||||||
public List<CollisionComponent> CollisionComponent;
|
public List<CollisionComponent> CollisionComponent;
|
||||||
public List<CollisionComponent> TriggerComponent;
|
public List<CollisionComponent> TriggerComponent;
|
||||||
|
|
||||||
|
public void RegisterComponent()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static bool CheckComponentCollision(List<CollisionComponent> collisionComponents, CollisionComponent component)
|
public static bool CheckComponentCollision(List<CollisionComponent> collisionComponents, CollisionComponent component)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,10 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
public class UpdateAnimation : UpdateData //хранит новую анимации
|
/// <summary>
|
||||||
|
/// Хранит новое сосотяние анимации
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateAnimation : UpdateData
|
||||||
{
|
{
|
||||||
public UpdateAnimation() { UpdateType = "UpdateAnimation"; }
|
public UpdateAnimation() { UpdateType = "UpdateAnimation"; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,10 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
public class UpdateEntityHealth : UpdateData//хранит новое хп entity
|
/// <summary>
|
||||||
|
/// Обнивляет хп сущности
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateEntityHealth : UpdateData
|
||||||
{
|
{
|
||||||
public UpdateEntityHealth() { UpdateType = "UpdateEntityHealth"; }
|
public UpdateEntityHealth() { UpdateType = "UpdateEntityHealth"; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,10 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
public class UpdateGameEnded : UpdateData //хранит полученый лут и уведомляет о конце игры
|
/// <summary>
|
||||||
|
/// Хранит полученый лут и уведомляет о конце игры
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateGameEnded : UpdateData
|
||||||
{
|
{
|
||||||
public UpdateGameEnded() { UpdateType = "UpdateGameEnded"; }
|
public UpdateGameEnded() { UpdateType = "UpdateGameEnded"; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,10 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
public class UpdateGameObjectCreated : UpdateData //Хранит объект, который только отправили
|
/// <summary>
|
||||||
|
/// Хранит объект, который только отправили
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateGameObjectCreated : UpdateData
|
||||||
{
|
{
|
||||||
public UpdateGameObjectCreated() { UpdateType = "UpdateGameObjectCreated"; }
|
public UpdateGameObjectCreated() { UpdateType = "UpdateGameObjectCreated"; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Хранит объект, который надо удлить
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateGameObjectDeleted : UpdateData
|
||||||
|
{
|
||||||
|
public UpdateGameObjectDeleted() { UpdateType = "UpdateGameObjectDeleted"; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// При попытке взаимодействия с объектом
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateInteraction : UpdateData
|
||||||
|
{
|
||||||
|
public int IdEntity { get; set; }
|
||||||
|
public string UpdateType { get; set; }
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// При изменении возможности повзаимодействовать с объектом
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idEntity"></param>
|
||||||
|
/// <param name="isReady"></param>
|
||||||
|
public class UpdateInteractionReady(int idEntity, bool isReady)
|
||||||
|
: UpdateData
|
||||||
|
{
|
||||||
|
public int IdEntity { get; set; } = idEntity;
|
||||||
|
public string UpdateType { get; set; }
|
||||||
|
public bool IsReady { get; set; } = isReady;
|
||||||
|
}
|
|
@ -6,7 +6,10 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
public class UpdateLoot : UpdateData //Хранит лут
|
/// <summary>
|
||||||
|
/// Хранит лут
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateLoot : UpdateData
|
||||||
{
|
{
|
||||||
public UpdateLoot() { UpdateType = "UpdateLoot"; }
|
public UpdateLoot() { UpdateType = "UpdateLoot"; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,10 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
public class UpdatePlayerParametrs : UpdateData //Хранит хп, радиацию
|
/// <summary>
|
||||||
|
/// Хранит хп, радиацию
|
||||||
|
/// </summary>
|
||||||
|
public class UpdatePlayerParametrs : UpdateData
|
||||||
{
|
{
|
||||||
public UpdatePlayerParametrs() { UpdateType = "UpdatePlayerParametrs"; }
|
public UpdatePlayerParametrs() { UpdateType = "UpdatePlayerParametrs"; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,10 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
public class UpdatePosition : UpdateData //Хранит новую позицию
|
/// <summary>
|
||||||
|
/// Хранит новую позицию
|
||||||
|
/// </summary>
|
||||||
|
public class UpdatePosition : UpdateData
|
||||||
{
|
{
|
||||||
public UpdatePosition() { UpdateType = "UpdatePosition"; }
|
public UpdatePosition() { UpdateType = "UpdatePosition"; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,9 @@ using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ClientToServer;
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// При создании тайла
|
||||||
|
/// </summary>
|
||||||
public class UpdateTileCreated : UpdateData
|
public class UpdateTileCreated : UpdateData
|
||||||
{
|
{
|
||||||
public UpdateTileCreated() { UpdateType = "UpdateTileCreated"; }
|
public UpdateTileCreated() { UpdateType = "UpdateTileCreated"; }
|
||||||
|
|
|
@ -14,12 +14,15 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates
|
||||||
[JsonDerivedType(typeof(UpdateEntityHealth))]
|
[JsonDerivedType(typeof(UpdateEntityHealth))]
|
||||||
[JsonDerivedType(typeof(UpdateGameEnded))]
|
[JsonDerivedType(typeof(UpdateGameEnded))]
|
||||||
[JsonDerivedType(typeof(UpdateGameObjectCreated))]
|
[JsonDerivedType(typeof(UpdateGameObjectCreated))]
|
||||||
|
[JsonDerivedType(typeof(UpdateGameObjectDeleted))]
|
||||||
[JsonDerivedType(typeof(UpdateLoot))]
|
[JsonDerivedType(typeof(UpdateLoot))]
|
||||||
[JsonDerivedType(typeof(UpdatePlayerParametrs))]
|
[JsonDerivedType(typeof(UpdatePlayerParametrs))]
|
||||||
[JsonDerivedType(typeof(UpdatePosition))]
|
[JsonDerivedType(typeof(UpdatePosition))]
|
||||||
[JsonDerivedType(typeof(UpdateTileCreated))]
|
[JsonDerivedType(typeof(UpdateTileCreated))]
|
||||||
[JsonDerivedType(typeof(UpdateInput))]
|
[JsonDerivedType(typeof(UpdateInput))]
|
||||||
[JsonDerivedType(typeof(UpdatePlayerExit))]
|
[JsonDerivedType(typeof(UpdatePlayerExit))]
|
||||||
|
[JsonDerivedType(typeof(UpdateInteractionReady))]
|
||||||
|
[JsonDerivedType(typeof(UpdateInteraction))]
|
||||||
|
|
||||||
public class UpdateData
|
public class UpdateData
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables;
|
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables;
|
||||||
public class Collectable : Entity
|
public class Collectable : Interactable
|
||||||
{
|
{
|
||||||
public Collectable(Vector2 position) : base(position)
|
public Collectable(Vector2 position) : base(position)
|
||||||
{
|
{
|
||||||
|
|
8
ZoFo/GameCore/GameObjects/Entities/Interactables/Door.cs
Normal file
8
ZoFo/GameCore/GameObjects/Entities/Interactables/Door.cs
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
namespace ZoFo.GameCore.GameObjects.Entities.Interactables;
|
||||||
|
|
||||||
|
public class Door
|
||||||
|
{
|
||||||
|
public bool isOpened;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using ZoFo.GameCore.GameManagers;
|
||||||
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
using ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameObjects.Entities.Interactables;
|
||||||
|
|
||||||
|
public class Interactable : Entity
|
||||||
|
{
|
||||||
|
public Interactable(Vector2 position) : base(position)
|
||||||
|
{
|
||||||
|
collisionComponent.OnTriggerEnter += (sender, e) => ChangeInteraction(sender, e, true);
|
||||||
|
collisionComponent.OnTriggerExit += (sender, e) => ChangeInteraction(sender, e, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ChangeInteraction(object sender, CollisionComponent e, bool isReady)
|
||||||
|
{
|
||||||
|
AppManager.Instance.server.AddData(new UpdateInteractionReady((sender as Player).Id, isReady));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnInteraction()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,7 +12,6 @@ public abstract class GameObject
|
||||||
{
|
{
|
||||||
public Vector2 position;
|
public Vector2 position;
|
||||||
|
|
||||||
private Server server;
|
|
||||||
public Vector2 rotation; //вектор направления объекта
|
public Vector2 rotation; //вектор направления объекта
|
||||||
public abstract GraphicsComponent graphicsComponent { get; }
|
public abstract GraphicsComponent graphicsComponent { get; }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue