From b0f9bbdeec738b5ad14a89087c08a836cee1d783 Mon Sep 17 00:00:00 2001 From: Mootfrost777 Date: Fri, 16 Aug 2024 23:12:12 +0300 Subject: [PATCH 1/5] Add Interatable class --- .../CollisionManager/CollisionManager.cs | 5 ++++- .../ServerToClient/UpdateInteraction.cs | 7 +++++++ .../UpdateInteractionAvailable.cs | 9 ++++++++ .../Interactables/Collectables/Collectable.cs | 2 +- .../Entities/Interactables/Interactable.cs | 21 +++++++++++++++++++ 5 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs create mode 100644 ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionAvailable.cs create mode 100644 ZoFo/GameCore/GameObjects/Entities/Interactables/Interactable.cs diff --git a/ZoFo/GameCore/GameManagers/CollisionManager/CollisionManager.cs b/ZoFo/GameCore/GameManagers/CollisionManager/CollisionManager.cs index 8cf63f2..5242d4a 100644 --- a/ZoFo/GameCore/GameManagers/CollisionManager/CollisionManager.cs +++ b/ZoFo/GameCore/GameManagers/CollisionManager/CollisionManager.cs @@ -17,7 +17,10 @@ namespace ZoFo.GameCore.GameManagers.CollisionManager public List CollisionComponent; public List TriggerComponent; - + public void RegisterComponent() + { + + } public static bool CheckComponentCollision(List collisionComponents, CollisionComponent component) { diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs new file mode 100644 index 0000000..6c87be3 --- /dev/null +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs @@ -0,0 +1,7 @@ +namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient; + +public class UpdateInteraction : IUpdateData // при попытке взаимодействия с объектом +{ + public int IdEntity { get; set; } + public string UpdateType { get; set; } +} \ No newline at end of file diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionAvailable.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionAvailable.cs new file mode 100644 index 0000000..26471f5 --- /dev/null +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionAvailable.cs @@ -0,0 +1,9 @@ +namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient; + +public class UpdateInteractionAvailable(int idEntity, bool isReady) + : IUpdateData // при изменении возможности повзаимодействовать с объектом +{ + public int IdEntity { get; set; } = idEntity; + public string UpdateType { get; set; } + public bool IsReady { get; set; } = isReady; +} \ No newline at end of file diff --git a/ZoFo/GameCore/GameObjects/Entities/Interactables/Collectables/Collectable.cs b/ZoFo/GameCore/GameObjects/Entities/Interactables/Collectables/Collectable.cs index b900e4a..d31d536 100644 --- a/ZoFo/GameCore/GameObjects/Entities/Interactables/Collectables/Collectable.cs +++ b/ZoFo/GameCore/GameObjects/Entities/Interactables/Collectables/Collectable.cs @@ -2,7 +2,7 @@ using System; namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables; -public class Collectable : Entity +public class Collectable : Interactable { public Collectable(Vector2 position) : base(position) { diff --git a/ZoFo/GameCore/GameObjects/Entities/Interactables/Interactable.cs b/ZoFo/GameCore/GameObjects/Entities/Interactables/Interactable.cs new file mode 100644 index 0000000..60d4576 --- /dev/null +++ b/ZoFo/GameCore/GameObjects/Entities/Interactables/Interactable.cs @@ -0,0 +1,21 @@ +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 UpdateInteractionAvailable((sender as Player).Id, isReady)); + } +} \ No newline at end of file From d8144c22c1a6db0893a412f1b07a1bdff19b8647 Mon Sep 17 00:00:00 2001 From: Mootfrost777 Date: Fri, 16 Aug 2024 23:31:09 +0300 Subject: [PATCH 2/5] Add door --- ZoFo/GameCore/GameObjects/Entities/Interactables/Door.cs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 ZoFo/GameCore/GameObjects/Entities/Interactables/Door.cs diff --git a/ZoFo/GameCore/GameObjects/Entities/Interactables/Door.cs b/ZoFo/GameCore/GameObjects/Entities/Interactables/Door.cs new file mode 100644 index 0000000..06bdec5 --- /dev/null +++ b/ZoFo/GameCore/GameObjects/Entities/Interactables/Door.cs @@ -0,0 +1,8 @@ +namespace ZoFo.GameCore.GameObjects.Entities.Interactables; + +public class Door +{ + public bool isOpened; + + +} \ No newline at end of file From 4d6c32bd3737be45651d4373676b8dc454f076f4 Mon Sep 17 00:00:00 2001 From: Mootfrost777 Date: Fri, 16 Aug 2024 23:52:51 +0300 Subject: [PATCH 3/5] Fix server --- .../Updates/ServerToClient/UpdateInteraction.cs | 2 +- .../Updates/ServerToClient/UpdateInteractionAvailable.cs | 2 +- ZoFo/GameCore/GameObjects/GameObject.cs | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs index 6c87be3..6b3f9cc 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs @@ -1,6 +1,6 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient; -public class UpdateInteraction : IUpdateData // при попытке взаимодействия с объектом +public class UpdateInteraction : UpdateData // при попытке взаимодействия с объектом { public int IdEntity { get; set; } public string UpdateType { get; set; } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionAvailable.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionAvailable.cs index 26471f5..3b7787b 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionAvailable.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionAvailable.cs @@ -1,7 +1,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient; public class UpdateInteractionAvailable(int idEntity, bool isReady) - : IUpdateData // при изменении возможности повзаимодействовать с объектом + : UpdateData // при изменении возможности повзаимодействовать с объектом { public int IdEntity { get; set; } = idEntity; public string UpdateType { get; set; } diff --git a/ZoFo/GameCore/GameObjects/GameObject.cs b/ZoFo/GameCore/GameObjects/GameObject.cs index 01dce1b..4847052 100644 --- a/ZoFo/GameCore/GameObjects/GameObject.cs +++ b/ZoFo/GameCore/GameObjects/GameObject.cs @@ -12,7 +12,6 @@ public abstract class GameObject { public Vector2 position; - private Server server; public Vector2 rotation; //вектор направления объекта public abstract GraphicsComponent graphicsComponent { get; } @@ -20,8 +19,7 @@ public abstract class GameObject public GameObject(Vector2 position) { this.position = position; - server = new Server(); - server.RegisterGameObject(this); + AppManager.Instance.server.RegisterGameObject(this); graphicsComponent.LoadContent(); } From 540727f0710039343063d6f1c79e682ac194684f Mon Sep 17 00:00:00 2001 From: Mootfrost777 Date: Sat, 17 Aug 2024 00:59:41 +0300 Subject: [PATCH 4/5] Add updates for interaction --- .../ServerToClient/UpdateGameObjectDeleted.cs | 13 +++++++++++++ ...actionAvailable.cs => UpdateInteractionReady.cs} | 2 +- .../NetworkManager/Updates/UpdateData.cs | 2 ++ .../Entities/Interactables/Interactable.cs | 7 ++++++- 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectDeleted.cs rename ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/{UpdateInteractionAvailable.cs => UpdateInteractionReady.cs} (83%) diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectDeleted.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectDeleted.cs new file mode 100644 index 0000000..cf8cdc7 --- /dev/null +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectDeleted.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient +{ + public class UpdateGameObjectDeleted : UpdateData //Хранит объект, который надоу удлить + { + public UpdateGameObjectDeleted() { UpdateType = "UpdateGameObjectDeleted"; } + } +} \ No newline at end of file diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionAvailable.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionReady.cs similarity index 83% rename from ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionAvailable.cs rename to ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionReady.cs index 3b7787b..1ccc49e 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionAvailable.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionReady.cs @@ -1,6 +1,6 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient; -public class UpdateInteractionAvailable(int idEntity, bool isReady) +public class UpdateInteractionReady(int idEntity, bool isReady) : UpdateData // при изменении возможности повзаимодействовать с объектом { public int IdEntity { get; set; } = idEntity; diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/UpdateData.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/UpdateData.cs index bb462ad..1074378 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/UpdateData.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/UpdateData.cs @@ -20,6 +20,8 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates [JsonDerivedType(typeof(UpdateTileCreated))] [JsonDerivedType(typeof(UpdateInput))] [JsonDerivedType(typeof(UpdatePlayerExit))] + [JsonDerivedType(typeof(UpdateInteractionReady))] + [JsonDerivedType(typeof(UpdateInteraction))] public class UpdateData { diff --git a/ZoFo/GameCore/GameObjects/Entities/Interactables/Interactable.cs b/ZoFo/GameCore/GameObjects/Entities/Interactables/Interactable.cs index 60d4576..6299155 100644 --- a/ZoFo/GameCore/GameObjects/Entities/Interactables/Interactable.cs +++ b/ZoFo/GameCore/GameObjects/Entities/Interactables/Interactable.cs @@ -16,6 +16,11 @@ public class Interactable : Entity private void ChangeInteraction(object sender, CollisionComponent e, bool isReady) { - AppManager.Instance.server.AddData(new UpdateInteractionAvailable((sender as Player).Id, isReady)); + AppManager.Instance.server.AddData(new UpdateInteractionReady((sender as Player).Id, isReady)); + } + + public void OnInteraction() + { + } } \ No newline at end of file From 58d6627af9ef9695a587ac2eeacdeb610aac92e3 Mon Sep 17 00:00:00 2001 From: Mootfrost777 Date: Sat, 17 Aug 2024 01:13:02 +0300 Subject: [PATCH 5/5] Add summary --- .../Updates/ServerToClient/UpdateAnimation.cs | 5 ++++- .../Updates/ServerToClient/UpdateEntityHealth.cs | 5 ++++- .../Updates/ServerToClient/UpdateGameEnded.cs | 5 ++++- .../Updates/ServerToClient/UpdateGameObjectCreated.cs | 5 ++++- .../Updates/ServerToClient/UpdateGameObjectDeleted.cs | 5 ++++- .../Updates/ServerToClient/UpdateInteraction.cs | 5 ++++- .../Updates/ServerToClient/UpdateInteractionReady.cs | 7 ++++++- .../NetworkManager/Updates/ServerToClient/UpdateLoot.cs | 5 ++++- .../Updates/ServerToClient/UpdatePlayerParametrs.cs | 5 ++++- .../Updates/ServerToClient/UpdatePosition.cs | 5 ++++- .../Updates/ServerToClient/UpdateTileCreated.cs | 3 +++ .../GameManagers/NetworkManager/Updates/UpdateData.cs | 1 + 12 files changed, 46 insertions(+), 10 deletions(-) diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateAnimation.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateAnimation.cs index 92fdc73..4e9b972 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateAnimation.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateAnimation.cs @@ -6,7 +6,10 @@ using System.Threading.Tasks; namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient { - public class UpdateAnimation : UpdateData //хранит новую анимации + /// + /// Хранит новое сосотяние анимации + /// + public class UpdateAnimation : UpdateData { public UpdateAnimation() { UpdateType = "UpdateAnimation"; } } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateEntityHealth.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateEntityHealth.cs index 7e1efd3..71f95a2 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateEntityHealth.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateEntityHealth.cs @@ -6,7 +6,10 @@ using System.Threading.Tasks; namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient { - public class UpdateEntityHealth : UpdateData//хранит новое хп entity + /// + /// Обнивляет хп сущности + /// + public class UpdateEntityHealth : UpdateData { public UpdateEntityHealth() { UpdateType = "UpdateEntityHealth"; } } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameEnded.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameEnded.cs index 193f6c1..d89c9a7 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameEnded.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameEnded.cs @@ -6,7 +6,10 @@ using System.Threading.Tasks; namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient { - public class UpdateGameEnded : UpdateData //хранит полученый лут и уведомляет о конце игры + /// + /// Хранит полученый лут и уведомляет о конце игры + /// + public class UpdateGameEnded : UpdateData { public UpdateGameEnded() { UpdateType = "UpdateGameEnded"; } } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectCreated.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectCreated.cs index d3a154f..32052a0 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectCreated.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectCreated.cs @@ -6,7 +6,10 @@ using System.Threading.Tasks; namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient { - public class UpdateGameObjectCreated : UpdateData //Хранит объект, который только отправили + /// + /// Хранит объект, который только отправили + /// + public class UpdateGameObjectCreated : UpdateData { public UpdateGameObjectCreated() { UpdateType = "UpdateGameObjectCreated"; } } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectDeleted.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectDeleted.cs index cf8cdc7..88d4e98 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectDeleted.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectDeleted.cs @@ -6,7 +6,10 @@ using System.Threading.Tasks; namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient { - public class UpdateGameObjectDeleted : UpdateData //Хранит объект, который надоу удлить + /// + /// Хранит объект, который надо удлить + /// + public class UpdateGameObjectDeleted : UpdateData { public UpdateGameObjectDeleted() { UpdateType = "UpdateGameObjectDeleted"; } } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs index 6b3f9cc..e42f0f4 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs @@ -1,6 +1,9 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient; -public class UpdateInteraction : UpdateData // при попытке взаимодействия с объектом +/// +/// При попытке взаимодействия с объектом +/// +public class UpdateInteraction : UpdateData { public int IdEntity { get; set; } public string UpdateType { get; set; } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionReady.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionReady.cs index 1ccc49e..db4d01d 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionReady.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionReady.cs @@ -1,7 +1,12 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient; +/// +/// При изменении возможности повзаимодействовать с объектом +/// +/// +/// public class UpdateInteractionReady(int idEntity, bool isReady) - : UpdateData // при изменении возможности повзаимодействовать с объектом + : UpdateData { public int IdEntity { get; set; } = idEntity; public string UpdateType { get; set; } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateLoot.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateLoot.cs index 19d390c..2337f74 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateLoot.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateLoot.cs @@ -6,7 +6,10 @@ using System.Threading.Tasks; namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient { - public class UpdateLoot : UpdateData //Хранит лут + /// + /// Хранит лут + /// + public class UpdateLoot : UpdateData { public UpdateLoot() { UpdateType = "UpdateLoot"; } } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdatePlayerParametrs.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdatePlayerParametrs.cs index 818dcce..100c8d0 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdatePlayerParametrs.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdatePlayerParametrs.cs @@ -6,7 +6,10 @@ using System.Threading.Tasks; namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient { - public class UpdatePlayerParametrs : UpdateData //Хранит хп, радиацию + /// + /// Хранит хп, радиацию + /// + public class UpdatePlayerParametrs : UpdateData { public UpdatePlayerParametrs() { UpdateType = "UpdatePlayerParametrs"; } } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdatePosition.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdatePosition.cs index ae58334..8d93d7b 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdatePosition.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdatePosition.cs @@ -6,7 +6,10 @@ using System.Threading.Tasks; namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient { - public class UpdatePosition : UpdateData //Хранит новую позицию + /// + /// Хранит новую позицию + /// + public class UpdatePosition : UpdateData { public UpdatePosition() { UpdateType = "UpdatePosition"; } } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateTileCreated.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateTileCreated.cs index 2002a34..0799653 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateTileCreated.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateTileCreated.cs @@ -11,6 +11,9 @@ using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ClientToServer; namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient { + /// + /// При создании тайла + /// public class UpdateTileCreated : UpdateData { public UpdateTileCreated() { UpdateType = "UpdateTileCreated"; } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/UpdateData.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/UpdateData.cs index 1074378..a96b270 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/UpdateData.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/UpdateData.cs @@ -14,6 +14,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates [JsonDerivedType(typeof(UpdateEntityHealth))] [JsonDerivedType(typeof(UpdateGameEnded))] [JsonDerivedType(typeof(UpdateGameObjectCreated))] + [JsonDerivedType(typeof(UpdateGameObjectDeleted))] [JsonDerivedType(typeof(UpdateLoot))] [JsonDerivedType(typeof(UpdatePlayerParametrs))] [JsonDerivedType(typeof(UpdatePosition))]