pub trait GameInterface: Send + Sync {
Show 13 methods
// Required methods
fn item_find(&self, item_id: i32) -> GameResult<Arc<ItemData>>;
fn location_find(&self, location_id: i32) -> GameResult<Arc<LocationData>>;
fn location_weather_current(
&self,
location: Arc<LocationData>,
) -> GameResult<Weather>;
fn species_find(&self, species_id: i32) -> GameResult<Arc<SpeciesData>>;
fn user_catch_specific_specimen(
&self,
user: &User,
species: Arc<SpeciesData>,
) -> GameResult<(Specimen, FishingHistoryEntry)>;
fn user_get_fishing_history(
&self,
user: &User,
species: Arc<SpeciesData>,
) -> GameResult<FishingHistoryEntry>;
fn user_find(&self, external_id: i64) -> GameResult<User>;
fn user_get_unlocked_locations(
&self,
user: &User,
) -> GameResult<Vec<UserLocationUnlock>>;
fn user_inventory(&self, user: &User) -> GameResult<Inventory>;
fn user_item_give(
&self,
user: &User,
item: Arc<ItemData>,
count: u64,
) -> GameResult<Item>;
fn user_register(&self, external_id: i64) -> GameResult<User>;
fn user_save(&self, user: User) -> GameResult<User>;
fn user_unlock_location(
&self,
user: &User,
location: Arc<LocationData>,
) -> GameResult<UserLocationUnlock>;
}Expand description
§Game Interface
The trait defining all available game operations. This interface is implemented
by the crate::game::Game struct to provide the actual game functionality. It serves as a
contract to ensure all required functionality is implemented and to prevent
accidental breaking changes.
Required Methods§
fn item_find(&self, item_id: i32) -> GameResult<Arc<ItemData>>
fn location_find(&self, location_id: i32) -> GameResult<Arc<LocationData>>
fn location_weather_current( &self, location: Arc<LocationData>, ) -> GameResult<Weather>
fn species_find(&self, species_id: i32) -> GameResult<Arc<SpeciesData>>
fn user_catch_specific_specimen( &self, user: &User, species: Arc<SpeciesData>, ) -> GameResult<(Specimen, FishingHistoryEntry)>
fn user_get_fishing_history( &self, user: &User, species: Arc<SpeciesData>, ) -> GameResult<FishingHistoryEntry>
fn user_find(&self, external_id: i64) -> GameResult<User>
fn user_get_unlocked_locations( &self, user: &User, ) -> GameResult<Vec<UserLocationUnlock>>
fn user_inventory(&self, user: &User) -> GameResult<Inventory>
fn user_item_give( &self, user: &User, item: Arc<ItemData>, count: u64, ) -> GameResult<Item>
fn user_register(&self, external_id: i64) -> GameResult<User>
fn user_save(&self, user: User) -> GameResult<User>
fn user_unlock_location( &self, user: &User, location: Arc<LocationData>, ) -> GameResult<UserLocationUnlock>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".