miwarnec / DOTSNET

Public DOTSNET issue tracker
20 stars 0 forks source link

Allow separate order/grouping of a system tagged with [Server, Client] #38

Open sam-bivens opened 3 years ago

sam-bivens commented 3 years ago

Problem When writing a system that runs on both the server and client, it is sometimes beneficial to order or group the system differently if it is on the server or on the client.

// UpdateInGroup will throw an error/warning on the server version because SomeClientGroup doesn't exist there
[UpdateInGroup(typeof(SomeClientGroup))] 
[Server, Client]
public class ClientAndServerSystem : ISystemBase
{
    protected override void OnUpdate() { }
}

Proposal Six new attributes needed: ClientUpdateInGroup, ClientUpdateAfter, ClientUpdateBefore, ServerUpdateInGroup, ServerUpdateAfter, ServerUpdateBefore

// Update in group attributes
[ClientUpdateInGroup(typeof(SomeClientGroup))] // new attribute
[ServerUpdateInGroup(typeof(SomeServerGroup))] // new attribute
[Server, Client]
public class ClientAndServerSystem : ISystemBase
{
    protected override void OnUpdate() { }
}

// Update before/after example
[ClientUpdateAfter(typeof(SomeClientSystem))] // new attribute
[ServerUpdateBefore(typeof(SomeServerSystem))] // new attribute
[Server, Client]
public class ClientAndServerSystem : ISystemBase
{
    protected override void OnUpdate() { }
}