Implement RPC Node
This commit is contained in:
parent
f7ee533d5a
commit
605e43273e
13 changed files with 524 additions and 206 deletions
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Godot;
|
||||
|
||||
|
|
@ -46,6 +47,14 @@ public class Sector
|
|||
});
|
||||
}
|
||||
|
||||
public void NetworkSync(long id)
|
||||
{
|
||||
GameObjects.ForEach(gameObject =>
|
||||
{
|
||||
gameObject.NetworkWrite(id, false);
|
||||
});
|
||||
}
|
||||
|
||||
public bool IsObjectInSector(GameObject gameObject)
|
||||
{
|
||||
return Helpers.IsInsideGlobalArea(GlobalStartCoordinates, GlobalEndCoordinates, gameObject.GlobalCoordinates);
|
||||
|
|
@ -58,7 +67,20 @@ public class Sector
|
|||
|
||||
public void SpawnObjects()
|
||||
{
|
||||
GameObjects.ForEach(GameManager.Singleton.Spawn);
|
||||
GameObjects.ForEach(GameManager.Instance.Spawn);
|
||||
}
|
||||
|
||||
public GameObject GetObjectById(Guid id)
|
||||
{
|
||||
foreach (GameObject gameObject in GameObjects)
|
||||
{
|
||||
if (gameObject.UUID.Equals(id))
|
||||
{
|
||||
return gameObject;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<Sector> GetNeighbouringSectors()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue