def command_update(self, from_state, to_state, objects): """Executes the UPDATE command from the Server. Returns True if the state transition is successful.""" logging.debug(f"command_update(): {from_state} -> {to_state}") self.__proto_message = ProtoMessage.input_message(self.__inputs) self.__game_state = objects return True
def command_update(self, from_state, to_state): """Executes the START command from the Server. Returns True if the state transition is successful.""" logging.debug(f"command_update(): {from_state} -> {to_state}") self.__proto_message = ProtoMessage.input_message( ["FORWARD", "LEFT", "FIRE"]) return True
def set_inputs(self, inputs): """Sets the list of input actions collected during a frame. These are sent to the server.""" if self.__fsm.state == ClientState.PLAYING: self.__proto_message = ProtoMessage.input_message(inputs)