working on multiplayer

This commit is contained in:
2025-06-24 14:45:45 +02:00
parent b1050f627b
commit 5a813f212c
67 changed files with 499 additions and 127 deletions

View File

@@ -0,0 +1,33 @@
using System.Collections.Generic;
using System.Threading;
using Cysharp.Threading.Tasks;
namespace RebootKit.Engine.Services.Simulation.Interactors {
public interface IInteractorAsync<in TInteractable> {
UniTask Interact(TInteractable target, CancellationToken cancellationToken);
}
public interface IInteractor<in TInteractable> {
void Interact(TInteractable target);
}
public class GroupInteractor<TInteractable> : IInteractor<TInteractable> {
readonly List<IInteractor<TInteractable>> m_Interactors = new List<IInteractor<TInteractable>>();
public void Interact(TInteractable target) {
foreach (IInteractor<TInteractable> interactor in m_Interactors) interactor.Interact(target);
}
public void Add(IInteractor<TInteractable> interactor) {
m_Interactors.Add(interactor);
}
public void Remove(IInteractor<TInteractable> interactor) {
m_Interactors.Remove(interactor);
}
public void RemoveAll() {
m_Interactors.Clear();
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: bbb4d95dfc6a479caeeaa9078c45f5b8
timeCreated: 1740881665