Initial import
This commit is contained in:
95
Assets/Scripts/NetCode/RpcCommands.cs
Normal file
95
Assets/Scripts/NetCode/RpcCommands.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
using Unity.Entities;
|
||||
using Unity.Mathematics;
|
||||
using Unity.NetCode;
|
||||
using EE2Clone.Core;
|
||||
|
||||
namespace EE2Clone.NetCode
|
||||
{
|
||||
/// <summary>
|
||||
/// Client requests to move selected units to a position.
|
||||
/// </summary>
|
||||
public struct MoveCommandRpc : IRpcCommand
|
||||
{
|
||||
public Entity UnitEntity;
|
||||
public float3 TargetPosition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Client requests to attack a target with selected units.
|
||||
/// </summary>
|
||||
public struct AttackCommandRpc : IRpcCommand
|
||||
{
|
||||
public Entity AttackerEntity;
|
||||
public Entity TargetEntity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Client requests to place a building.
|
||||
/// </summary>
|
||||
public struct PlaceBuildingRpc : IRpcCommand
|
||||
{
|
||||
public BuildingType Type;
|
||||
public float3 Position;
|
||||
public quaternion Rotation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Client requests to set a rally point on a building.
|
||||
/// </summary>
|
||||
public struct SetRallyPointRpc : IRpcCommand
|
||||
{
|
||||
public Entity BuildingEntity;
|
||||
public float3 Position;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Client requests to queue unit production in a building.
|
||||
/// </summary>
|
||||
public struct QueueUnitProductionRpc : IRpcCommand
|
||||
{
|
||||
public Entity BuildingEntity;
|
||||
public int UnitDataId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Client requests to gather from a resource node.
|
||||
/// </summary>
|
||||
public struct GatherCommandRpc : IRpcCommand
|
||||
{
|
||||
public Entity CitizenEntity;
|
||||
public Entity ResourceNodeEntity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Client requests to assign citizens to build/repair a building.
|
||||
/// </summary>
|
||||
public struct BuildRepairCommandRpc : IRpcCommand
|
||||
{
|
||||
public Entity CitizenEntity;
|
||||
public Entity BuildingEntity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Client requests to research a technology.
|
||||
/// </summary>
|
||||
public struct ResearchTechRpc : IRpcCommand
|
||||
{
|
||||
public Entity BuildingEntity;
|
||||
public int TechId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Client requests to advance to the next epoch.
|
||||
/// </summary>
|
||||
public struct EpochAdvanceRpc : IRpcCommand
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Client requests to stop selected units.
|
||||
/// </summary>
|
||||
public struct StopCommandRpc : IRpcCommand
|
||||
{
|
||||
public Entity UnitEntity;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user