pub enum OrchestratorToExplorer {
StartExplorerAI,
ResetExplorerAI,
KillExplorer,
StopExplorerAI,
MoveToPlanet {
sender_to_new_planet: Option<Sender<ExplorerToPlanet>>,
planet_id: ID,
},
CurrentPlanetRequest,
SupportedResourceRequest,
SupportedCombinationRequest,
GenerateResourceRequest {
to_generate: BasicResourceType,
},
CombineResourceRequest {
to_generate: ComplexResourceType,
},
BagContentRequest,
NeighborsResponse {
neighbors: Vec<ID>,
},
}Expand description
This enum describes all possible messages from the Orchestrator to an Explorer
Variants§
StartExplorerAI
This variant is used to start an Explorer AI
Expected Response: ExplorerToOrchestrator::StartExplorerAIResult
Use Case: Starting the Explorer AI at game start
ResetExplorerAI
This variant is used to reset the Explorer AI and restart it if it is in manual mode
Expected Response: ExplorerToOrchestrator::ResetExplorerAIResult
Use Case: Reset the Explorer knowledge or restart the AI if it is in manual mode
KillExplorer
This variant is used to kill an Explorer
Expected Response: ExplorerToOrchestrator::KillExplorerResult
Use Case: Killing the explorer instantly
StopExplorerAI
This variant is used to stop the Explorer AI from autonomous decision-making
Expected Response: ExplorerToOrchestrator::StopExplorerAIResult
Use Case: Stopping the autonomous decision-making and entering the manual mode
MoveToPlanet
This variant is used to tell the Explorer to move to a different planet
Expected Response: ExplorerToOrchestrator::MovedToPlanetResult
Use Case
When in manual mode, the orchestrator moves the explorer to a new planet and gives the new Sender
When in normal mode, this is the response to ExplorerToOrchestrator::TravelToPlanetRequest, in this case
the orchestrator checks that the explorer can move to the planet specified in the request and sends the optional new sender
Fields
sender_to_new_planet: Option<Sender<ExplorerToPlanet>>CurrentPlanetRequest
This variant is used to ask the ID of the Planet in which the Explorer is currently located
Expected Response: ExplorerToOrchestrator::CurrentPlanetResult
SupportedResourceRequest
This variant is used to enforce the Explorer to ask the supported Resources on the Planet
Expected Response: ExplorerToOrchestrator::SupportedResourceResult
Use Case: In manual mode, ask the explorer to send a ExplorerToPlanet::SupportedResourceRequest to know the available BasicResourceType on its current planet
SupportedCombinationRequest
This variant is used to enforce the Explorer to ask the supported Combinations on the Planet
Expected Response: ExplorerToOrchestrator::SupportedCombinationResult
Use Case: In manual mode, ask the explorer to send a ExplorerToPlanet::SupportedCombinationRequest to know the available ComplexResourceType on its current planet
GenerateResourceRequest
This variant is used to enforce the Explorer to ask the Planet to Generate a BasicResource
Expected Response: ExplorerToOrchestrator::GenerateResourceResponse
Use Case: In manual mode, ask the explorer to send a ExplorerToPlanet::GenerateResourceRequest craft a BasicResource
Fields
to_generate: BasicResourceTypeThe type of basic resource to craft
CombineResourceRequest
This variant is used to enforce the Explorer to ask the Planet to Generate a ComplexResource provided by ComplexResourceType
Expected Response: ExplorerToOrchestrator::CombineResourceResponse
Use Case: In manual mode, ask the explorer to send a ExplorerToPlanet::CombineResourceRequest to craft a ComplexResource
Fields
to_generate: ComplexResourceTypeThe type of complex resource to generate
BagContentRequest
This variant is used to ask the content of the Explorer Bag
Expected Response: ExplorerToOrchestrator::BagContentResponse
Use Case: Message used by the GUI to get information on the Explorer bag content to be shown
NeighborsResponse
This variant is used to send to the Explorer the IDs of the planets to which it can be moved
Response To: ExplorerToOrchestrator::NeighborsRequest
Implementations§
Source§impl OrchestratorToExplorer
impl OrchestratorToExplorer
Sourcepub fn is_start_explorer_ai(&self) -> bool
pub fn is_start_explorer_ai(&self) -> bool
Returns true if this is a OrchestratorToExplorer::StartExplorerAI, otherwise false
Sourcepub fn is_reset_explorer_ai(&self) -> bool
pub fn is_reset_explorer_ai(&self) -> bool
Returns true if this is a OrchestratorToExplorer::ResetExplorerAI, otherwise false
Sourcepub fn is_kill_explorer(&self) -> bool
pub fn is_kill_explorer(&self) -> bool
Returns true if this is a OrchestratorToExplorer::KillExplorer, otherwise false
Sourcepub fn is_stop_explorer_ai(&self) -> bool
pub fn is_stop_explorer_ai(&self) -> bool
Returns true if this is a OrchestratorToExplorer::StopExplorerAI, otherwise false
Sourcepub fn is_move_to_planet(&self) -> bool
pub fn is_move_to_planet(&self) -> bool
Returns true if this is a OrchestratorToExplorer::MoveToPlanet, otherwise false
Sourcepub fn as_move_to_planet_mut(
&mut self,
) -> Option<(&mut Option<Sender<ExplorerToPlanet>>, &mut ID)>
pub fn as_move_to_planet_mut( &mut self, ) -> Option<(&mut Option<Sender<ExplorerToPlanet>>, &mut ID)>
Optionally returns mutable references to the inner fields if this is a OrchestratorToExplorer::MoveToPlanet, otherwise None
Sourcepub fn as_move_to_planet(
&self,
) -> Option<(&Option<Sender<ExplorerToPlanet>>, &ID)>
pub fn as_move_to_planet( &self, ) -> Option<(&Option<Sender<ExplorerToPlanet>>, &ID)>
Optionally returns references to the inner fields if this is a OrchestratorToExplorer::MoveToPlanet, otherwise None
Sourcepub fn into_move_to_planet(
self,
) -> Result<(Option<Sender<ExplorerToPlanet>>, ID), Self>
pub fn into_move_to_planet( self, ) -> Result<(Option<Sender<ExplorerToPlanet>>, ID), Self>
Returns the inner fields if this is a OrchestratorToExplorer::MoveToPlanet, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_current_planet_request(&self) -> bool
pub fn is_current_planet_request(&self) -> bool
Returns true if this is a OrchestratorToExplorer::CurrentPlanetRequest, otherwise false
Sourcepub fn is_supported_resource_request(&self) -> bool
pub fn is_supported_resource_request(&self) -> bool
Returns true if this is a OrchestratorToExplorer::SupportedResourceRequest, otherwise false
Sourcepub fn is_supported_combination_request(&self) -> bool
pub fn is_supported_combination_request(&self) -> bool
Returns true if this is a OrchestratorToExplorer::SupportedCombinationRequest, otherwise false
Sourcepub fn is_generate_resource_request(&self) -> bool
pub fn is_generate_resource_request(&self) -> bool
Returns true if this is a OrchestratorToExplorer::GenerateResourceRequest, otherwise false
Sourcepub fn as_generate_resource_request_mut(
&mut self,
) -> Option<&mut BasicResourceType>
pub fn as_generate_resource_request_mut( &mut self, ) -> Option<&mut BasicResourceType>
Optionally returns mutable references to the inner fields if this is a OrchestratorToExplorer::GenerateResourceRequest, otherwise None
Sourcepub fn as_generate_resource_request(&self) -> Option<&BasicResourceType>
pub fn as_generate_resource_request(&self) -> Option<&BasicResourceType>
Optionally returns references to the inner fields if this is a OrchestratorToExplorer::GenerateResourceRequest, otherwise None
Sourcepub fn into_generate_resource_request(self) -> Result<BasicResourceType, Self>
pub fn into_generate_resource_request(self) -> Result<BasicResourceType, Self>
Returns the inner fields if this is a OrchestratorToExplorer::GenerateResourceRequest, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_combine_resource_request(&self) -> bool
pub fn is_combine_resource_request(&self) -> bool
Returns true if this is a OrchestratorToExplorer::CombineResourceRequest, otherwise false
Sourcepub fn as_combine_resource_request_mut(
&mut self,
) -> Option<&mut ComplexResourceType>
pub fn as_combine_resource_request_mut( &mut self, ) -> Option<&mut ComplexResourceType>
Optionally returns mutable references to the inner fields if this is a OrchestratorToExplorer::CombineResourceRequest, otherwise None
Sourcepub fn as_combine_resource_request(&self) -> Option<&ComplexResourceType>
pub fn as_combine_resource_request(&self) -> Option<&ComplexResourceType>
Optionally returns references to the inner fields if this is a OrchestratorToExplorer::CombineResourceRequest, otherwise None
Sourcepub fn into_combine_resource_request(self) -> Result<ComplexResourceType, Self>
pub fn into_combine_resource_request(self) -> Result<ComplexResourceType, Self>
Returns the inner fields if this is a OrchestratorToExplorer::CombineResourceRequest, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_bag_content_request(&self) -> bool
pub fn is_bag_content_request(&self) -> bool
Returns true if this is a OrchestratorToExplorer::BagContentRequest, otherwise false
Sourcepub fn is_neighbors_response(&self) -> bool
pub fn is_neighbors_response(&self) -> bool
Returns true if this is a OrchestratorToExplorer::NeighborsResponse, otherwise false
Sourcepub fn as_neighbors_response_mut(&mut self) -> Option<&mut Vec<ID>>
pub fn as_neighbors_response_mut(&mut self) -> Option<&mut Vec<ID>>
Optionally returns mutable references to the inner fields if this is a OrchestratorToExplorer::NeighborsResponse, otherwise None
Sourcepub fn as_neighbors_response(&self) -> Option<&Vec<ID>>
pub fn as_neighbors_response(&self) -> Option<&Vec<ID>>
Optionally returns references to the inner fields if this is a OrchestratorToExplorer::NeighborsResponse, otherwise None
Sourcepub fn into_neighbors_response(self) -> Result<Vec<ID>, Self>
pub fn into_neighbors_response(self) -> Result<Vec<ID>, Self>
Returns the inner fields if this is a OrchestratorToExplorer::NeighborsResponse, otherwise returns back the enum in the Err case of the result