private void _updatePosition(Vector2 pos, Heading head, long apianTime) { optTime = apianTime; optPendingTurn = TurnDir.kUnset; optHeading = head; optPosition = pos; logger.Verbose($"_updatePosition() Bike: {bikeId}, Pos: {pos.ToString()} Head: {baseHeading.ToString()}"); }
public abstract void SetupImpl(); // do any implmentation-specific setup public virtual void Loop(long curTime, int frameMs) { bbDynState = bb.DynamicState(curTime); if (stashedTurn != TurnDir.kUnset) { if (!bb.CloseToGridPoint(bbDynState.position)) { // Turn is requested, and we are not close to a point Logger.Verbose($"{this.GetType().Name} Bike {bb.name} Executing turn."); appCore.PostBikeTurn(bb, stashedTurn); stashedTurn = TurnDir.kUnset; } } }
protected void RemoveActivePlace(BeamPlace p) { if (p != null) { Logger.Verbose($"RemoveActivePlace({p.GetPos().ToString()}) Bike: {p.bike?.bikeId}"); PlaceFreedEvt?.Invoke(this, p); freePlaces.Push(p); // add to free list activePlaces.Remove(p.PosHash); _reportedTimedOutPlaces.Remove(p.PosHash); p.bike = null; // this is the only reference it holds } }
public void OnPlayersClearedEvt(object sender, EventArgs e) { // Probably never will do anything logger.Verbose("OnClearPeers() currently does nothing"); }
public void OnCreateBikeCmd(BikeCreateDataMsg msg) { logger.Verbose($"OnCreateBikeCmd(): {msg.bikeId}."); IBike ib = msg.ToBike(CoreData); logger.Verbose($"** OnCreateBike() created {ib.bikeId} at ({ib.basePosition.x}, {ib.basePosition.y})"); if (_AddBike(ib)) { // *** Bikes are created stationary now - so there's no need to correct for creation time delay logger.Verbose($"OnCreateBike() created {ib.bikeId} at ({ib.basePosition.x}, {ib.basePosition.y})"); } }