public HttpResponseMessage Move(HttpRequestMessage msg, int direction, int speed) { _tankBot.Move((short)speed, absoluteHeading: (short)direction); var response = msg.GetResponseMessage(); response.ContentType = "application/json"; response.Content = "{'status':'ok'}"; return(response); }
private void Client_MessageRecevied(object sender, NetworkMessage e) { switch (e.MessageTypeCode) { case Move.MessageTypeId: { var movePayload = e.DeserializePayload <Move>(); _tankBot.Move(movePayload.Speed, movePayload.RelativeHeading, movePayload.AbsoluteHeading, movePayload.Duration); } break; case Core.Messages.Stop.MessageTypeId: _tankBot.Stop(); break; } }
public override void Move(short direction) { _mblockTankBot.Move(Speed, direction); }