Add updates for interaction
This commit is contained in:
parent
4d6c32bd37
commit
540727f071
4 changed files with 22 additions and 2 deletions
|
@ -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"; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
|
||||||
public class UpdateInteractionAvailable(int idEntity, bool isReady)
|
public class UpdateInteractionReady(int idEntity, bool isReady)
|
||||||
: UpdateData // при изменении возможности повзаимодействовать с объектом
|
: UpdateData // при изменении возможности повзаимодействовать с объектом
|
||||||
{
|
{
|
||||||
public int IdEntity { get; set; } = idEntity;
|
public int IdEntity { get; set; } = idEntity;
|
|
@ -20,6 +20,8 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates
|
||||||
[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
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,6 +16,11 @@ public class Interactable : Entity
|
||||||
|
|
||||||
private void ChangeInteraction(object sender, CollisionComponent e, bool isReady)
|
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()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue