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