Beispiel #1
0
 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);
 }
Beispiel #2
0
        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;
 }
Beispiel #4
0
 void Start()
 {
     identity = PlayerManager.Identity.ID;
     lockstep = LockstepLogic.Instance;
 }