public Simulation(double deltaTime, double maxTime, int numFrames) { running = true; accumulator = 0.0; totalTime = 0.0; targetTime = deltaTime; maximumTime = maxTime; stopwatch = new Stopwatch(); entities = new List <IGameBehaviour>(); lockstep = new LockstepLogic(numFrames); }
public void Init() { //get the client's ID, so that we can use it inside the sim thread myIdentity = PlayerManager.Identity.ID; //initialize singleton instances Register(lockstep); LockstepLogic.InitSingleton(); //run init on every entity foreach (IGameBehaviour entity in entities) { entity.Init(); } stopwatch.Start(); }
public LockstepFixedUpdate(LockstepLogic lockstepLogic) { _lockstepLogic = lockstepLogic; }
void Start() { identity = PlayerManager.Identity.ID; lockstep = LockstepLogic.Instance; }