// Bikes public void OnNewBikeEvt(object sender, IBike ib) { logger.Info($"OnNewBikeEvt(). Id: {SID(ib.bikeId)}, Local: {ib.peerId == appCore.LocalPeerId}, AI: {ib.ctrlType == BikeFactory.AiCtrl}"); FrontendBike b = FeBikeFactory.Create(ib, ib.peerId == appCore.LocalPeerId); b.Setup(ib, beamAppl, appCore); feBikes[ib.bikeId] = b; }
public static FrontendBike Create(IBike ib, bool isLocal) { FrontendBike feb = null; if (isLocal) { switch (ib.ctrlType) { case BikeFactory.LocalPlayerCtrl: feb = new PlayerBike(); break; case BikeFactory.AiCtrl: feb = new AiBike(); break; } } else { feb = new RemoteBike(); } return(feb); }