public void onTick(double bouncerX, string criticalHits, string executedRequestsData) { sim.simulateEightTicks(criticalHits, executedRequestsData); var args = new TickArgs(bouncerX, criticalHits, string.Join("$", sim.requestsExecutedAt8Ticks.ToArray())); if (finishedGame) Console.WriteLine("Sending last piece of data to opp (with finish req): ex req: " + args.executedRequests + " crit hits: " + args.criticalHits); dispatchTickData(args); }
protected void dispatchTickData(TickArgs args) { tick(this, args); }
private void onTick() { (sim as NPCFieldSimulation).simulateEightTicks(); var args = new TickArgs(sim.bouncer.x, string.Join(",", (sim as NPCFieldSimulation).criticalHits.ToArray()), string.Join("$", sim.requestsExecutedAt8Ticks.ToArray())); Console.WriteLine("SENDING NPCS HITS: " + string.Join(",", (sim as NPCFieldSimulation).criticalHits.ToArray())); dispatchTickData(args); if (sim.ballsManager.currentTick%2 == 0 && !finishedGame) //every 0.5 sec frequency of _tickTimer's ticks is adjusted so that both player and NPC run on the same pace syncTimer(); }