private void ChangeObjectHeading(Message_BotPerformAction actionMessage, MappedBot bt) { bt.Heading = actionMessage.DParameter; NavigationInfoContext nic = new NavigationInfoContext(); nic.SetBot(bt); nic.BotId = bt.EngineId; nic.NewHeading = bt.Heading; //nic.Kind = MainMessageKind.MapObjectMovementChange; //nic.SubKind = KnownSubkinds.DirectionChange; hub.Launch <Message_Ui>(new Message_Ui(MainMessageKind.MapObjectMovementChange, KnownSubkinds.DirectionChange) { RequestContext = nic }); }
private void ChangeBotSpeed(MappedBot bt, int p) { if (bt.TurnsAccelerationActionsRemaining > 0) { var ppi = (PowerPackEquipmentItem)equipment.GetEquipmentTypeById(bt.Bot.GetPowerPack().EquipmentId); bt.TurnsAccelerationActionsRemaining--; int tSpeed = bt.Speed + p; if ((tSpeed >= 0) && (tSpeed <= ppi.MaxSpeed)) { bt.Speed = tSpeed; NavigationInfoContext nic = new NavigationInfoContext(); nic.SetBot(bt); nic.SpeedDelta = tSpeed; hub.Launch <Message_Ui>(new Message_Ui(MainMessageKind.MapObjectMovementChange, KnownSubkinds.ChangeSpeed) { RequestContext = nic }); } } }