/// <summary> /// Updates the systems, allowing for each <see cref="IClientSystem"/> to run its logic on the given <see cref="EntityArray"/>. /// </summary> public void ClientUpdate(EntityArray entityArray, Entity commandingEntity) { entityArray.BeginUpdate(); foreach (IClientSystem system in this.systems) { system.ClientUpdate(entityArray, commandingEntity); } entityArray.EndUpdate(); }
/// <summary> /// Updates the systems, allowing for each <see cref="IServerSystem"/> to run its logic on the given <see cref="EntityArray"/>. /// </summary> public void ServerUpdate(EntityArray entityArray) { entityArray.BeginUpdate(); foreach (IServerSystem system in this.systems) { system.ServerUpdate(entityArray); } entityArray.EndUpdate(); }
/// <summary> /// Updates the systems for a specific client's command on a commanding entity. The provided lag compensated entity array might be null /// but otherwise contains the rough state of the server at the time the client issued the command (the client's render frame). /// </summary> public void ProcessClientCommand <TCommandData>(EntityArray entityArray, Entity commandingEntity, TCommandData commandData, EntityArray lagCompensatedEntityArray) where TCommandData : struct, ICommandData { entityArray.BeginUpdate(); foreach (IServerSystem system in this.systems) { if (system is IServerCommandProcessorSystem <TCommandData> serverCommandProcessorSystem) { serverCommandProcessorSystem.ProcessClientCommand(entityArray, commandingEntity, commandData, lagCompensatedEntityArray); } } entityArray.EndUpdate(); }