pub struct GameOptionsBuilder {
pub choice_atlantis: Option<&'static str>,
pub choice_olympus: Option<&'static str>,
pub atlantis_atlantis: Option<NumberPair>,
pub atlantis_olympus: Option<NumberPair>,
pub olympus_atlantis: Option<NumberPair>,
pub olympus_olympus: Option<NumberPair>,
/* private fields */
}Expand description
A builder struct to create a GameOptions.
This struct is designed to encapsulate different ways of generating a new
GameOptions struct. It is designed to be used in conjunction with the
GameOptions struct.
The GameOptionsBuilder::new() method is used to create a new builder,
which takes a builder_type argument. This argument is used to determine
which variant of the builder is used. The builder_type argument can be one
of the following:
- “randomized”: This creates a builder of type
GameOptionsBuilderTypes::Randomized. - “seeded”: This creates a builder of type
GameOptionsBuilderTypes::Seeded - “customized”: This creates a builder of type
GameOptionsBuilderTypes::Customized
Each of these variants has different fields that can be set and serve different purposes. The following table shows which fields should be set for each variant:
| Field | Randomized | Seeded | Customized | Type | Default |
|---|---|---|---|---|---|
min_value | Yes | No | Yes | u32 | 1 |
max_value | Yes | No | Yes | u32 | 10 |
choice_atlantis | Yes | Yes | Yes | &’static str | “cooperate” |
choice_olympus | Yes | Yes | Yes | &’static str | “defect” |
atlantis_atlantis | No | No | Yes | NumberPair | NumberPair::new(4, 4) |
atlantis_olympus | No | No | Yes | NumberPair | NumberPair::new(0, 5) |
olympus_atlantis | No | No | Yes | NumberPair | NumberPair::new(5, 0) |
olympus_olympus | No | No | Yes | NumberPair | NumberPair::new(3, 3) |
seed | No | Yes | No | u64 | None |
§Example
§RandomizedBuilder
This builder path takes in the lower bound and the upper bound for the scores that can be assigned to each option. It then generates a random score for each option within the given bounds.
use dilemma_tactix_lib::{
GameOptionsBuilder as Builder,
GameOptionsBuilderTypes as BuilderTypes,
NumberPair,
};
let builder = Builder::new(BuilderTypes::Randomized);
let builder = builder.min_value(1);
let builder = builder?.max_value(10);
let builder = builder?.choice_atlantis("cooperate");
let builder = builder?.choice_olympus("defect");
let game_options = builder?.build();
§SeededBuilder
This builder path takes in the lower bound and the upper bound for the
scores that can be assigned to each option. It also takes a seed value
It then generates a random score for each option within the given
bounds and the given seed.
use dilemma_tactix_lib::{
GameOptionsBuilder as Builder,
GameOptionsBuilderTypes as BuilderTypes,
};
let builder = Builder::new(BuilderTypes::Seeded);§CustomizedBuilder
This builder allows you to set all the scores for each possible
outcome individually. This allows for the most customization of the
GameOptions struct.
use dilemma_tactix_lib::{
GameOptionsBuilder as Builder,
GameOptionsBuilderTypes as BuilderTypes,
NumberPair,
};
let builder = Builder::new(BuilderTypes::Customized);
let builder = builder.choice_atlantis("cooperate");
let builder = builder?.choice_olympus("defect");
let builder = builder?.atlantis_atlantis(NumberPair::new(4, 4));
let builder = builder?.atlantis_olympus(NumberPair::new(0, 5));
let builder = builder?.olympus_atlantis(NumberPair::new(5, 0));
let builder = builder?.olympus_olympus(NumberPair::new(3, 3));
let game_options = builder?.build();
§Notes
I chose to use the Builder pattern here because it allows for easier
manipulation of the GameOptions struct. I also used a State or Variant
pattern here because it had the lowest complexity in terms of understanding
the flow of options that need to be set.
§See Also
Fields§
§choice_atlantis: Option<&'static str>§choice_olympus: Option<&'static str>§atlantis_atlantis: Option<NumberPair>§atlantis_olympus: Option<NumberPair>§olympus_atlantis: Option<NumberPair>§olympus_olympus: Option<NumberPair>Implementations§
Source§impl GameOptionsBuilder
impl GameOptionsBuilder
Sourcepub const fn new(builder_type: GameOptionsBuilderTypes) -> Self
pub const fn new(builder_type: GameOptionsBuilderTypes) -> Self
Creates a new GameOptionsBuilder struct.
This associated function creates a new GameOptionsBuilder struct with
the given builder_type. The builder_type argument can be one of the
following:
- “randomized”: This creates a builder of type
GameOptionsBuilderTypes::Randomized. - “seeded”: This creates a builder of type
GameOptionsBuilderTypes::Seeded - “customized”: This creates a builder of type
GameOptionsBuilderTypes::Customized
§Arguments
builder_type- The type of builder to create.
§Example
§RandomizedBuilder
This builder path takes in the lower bound and the upper bound for the scores that can be assigned to each option. It then generates a random score for each option within the given bounds.
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Randomized);§SeededBuilder
This builder path takes in the lower bound and the upper bound for the
scores that can be assigned to each option. It also takes a seed value
It then generates a random score for each option within the given
bounds and the given seed.
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Seeded);§CustomizedBuilder
This builder allows you to set all the scores for each possible
outcome individually. This allows for the most customization of the
GameOptions struct.
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Customized);§Returns
A new GameOptionsBuilder struct with a given builder type.
§See Also
GameOptionsBuilder::build()GameOptionsBuilder::min_value()GameOptionsBuilder::max_value()GameOptionsBuilder::choice_atlantis()GameOptionsBuilder::choice_olympus()GameOptionsBuilder::atlantis_atlantis()GameOptionsBuilder::atlantis_olympus()GameOptionsBuilder::olympus_atlantis()GameOptionsBuilder::olympus_olympus()GameOptionsBuilder::seed()
Sourcepub fn min_value(self, min_value: u32) -> Result<Self, BuilderError>
pub fn min_value(self, min_value: u32) -> Result<Self, BuilderError>
Sets the minimum value for the GameOptions.
This function sets the minimum value for the GameOptions struct that
is being built. This function is only valid for the
GameOptionsBuilderTypes::Randomized
and the GameOptionsBuilderTypes::Seeded
variants of the GameOptionsBuilder struct.
§Arguments
min_value- The minimum value for theGameOptions.
§Example
§RandomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Randomized)
.min_value(1);
assert!(game_options_builder.is_ok());§SeededBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Seeded).min_value(1);
assert!(game_options_builder.is_ok());§CustomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Customized)
.min_value(1);
assert!(game_options_builder.is_err());§Errors
This function will return an error if the builder_type is
GameOptionsBuilderTypes::Customized.
§Returns
The GameOptionsBuilder struct with the min_value field set.
§See Also
GameOptionsBuilder::new()GameOptionsBuilder::build()GameOptionsBuilder::max_value()GameOptionsBuilder::choice_atlantis()GameOptionsBuilder::choice_olympus()GameOptionsBuilder::atlantis_atlantis()GameOptionsBuilder::atlantis_olympus()GameOptionsBuilder::olympus_atlantis()GameOptionsBuilder::olympus_olympus()GameOptionsBuilder::seed()
Sourcepub fn max_value(self, max_value: u32) -> Result<Self, BuilderError>
pub fn max_value(self, max_value: u32) -> Result<Self, BuilderError>
Sets the maximum value for the GameOptions.
This function sets the maximum value for the GameOptions struct that
is being built. This function is only valid for the
GameOptionsBuilderTypes::Randomized
and the GameOptionsBuilderTypes::Seeded
variants of the GameOptionsBuilder struct.
§Arguments
max_value- The maximum value for theGameOptions.
§Example
§RandomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Randomized)
.max_value(10);
assert!(game_options_builder.is_ok());§SeededBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Seeded).max_value(10);
assert!(game_options_builder.is_ok());§CustomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Customized)
.max_value(10);
assert!(game_options_builder.is_err());§Errors
This function will return an error if the builder_type is
GameOptionsBuilderTypes::Customized.
§Returns
The GameOptionsBuilder struct with the max_value field set.
§See Also
GameOptionsBuilder::new()GameOptionsBuilder::build()GameOptionsBuilder::min_value()GameOptionsBuilder::choice_atlantis()GameOptionsBuilder::choice_olympus()GameOptionsBuilder::atlantis_atlantis()GameOptionsBuilder::atlantis_olympus()GameOptionsBuilder::olympus_atlantis()GameOptionsBuilder::olympus_olympus()GameOptionsBuilder::seed()
Sourcepub fn choice_atlantis(
self,
choice_atlantis: &'static str,
) -> Result<Self, BuilderError>
pub fn choice_atlantis( self, choice_atlantis: &'static str, ) -> Result<Self, BuilderError>
Sets the first choice available to players in GameOptions.
This function sets the first choice available to players in
GameOptions. This function is valid for all variants of the
GameOptionsBuilder struct.
§Arguments
choice_atlantis- The first choice available to players inGameOptions.
§Example
§RandomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Randomized)
.choice_atlantis("cooperate");
let game_options = game_options_builder.unwrap().build();
§SeededBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
use rand::SeedableRng;
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Seeded)
.choice_atlantis("cooperate");
let game_options = game_options_builder.unwrap().build();
§CustomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Customized)
.choice_atlantis("cooperate");
let game_options = game_options_builder.unwrap().build();
§Errors
This function will return an error if the choice_atlantis argument is
empty.
§Returns
The GameOptionsBuilder struct with the choice_atlantis field set.
§See Also
GameOptionsBuilder::new()GameOptionsBuilder::build()GameOptionsBuilder::max_value()GameOptionsBuilder::min_value()GameOptionsBuilder::choice_olympus()GameOptionsBuilder::atlantis_atlantis()GameOptionsBuilder::atlantis_olympus()GameOptionsBuilder::olympus_atlantis()GameOptionsBuilder::olympus_olympus()GameOptionsBuilder::seed()
Sourcepub fn choice_olympus(
self,
choice_olympus: &'static str,
) -> Result<Self, BuilderError>
pub fn choice_olympus( self, choice_olympus: &'static str, ) -> Result<Self, BuilderError>
Sets the second choice available to players in GameOptions.
This function sets the second choice available to players in
GameOptions. This function is valid for all variants of the
GameOptionsBuilder struct.
§Arguments
choice_olympus- The second choice available to players inGameOptions.
§Example
§RandomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Randomized)
.choice_olympus("defect");
let game_options = game_options_builder.unwrap().build();
§SeededBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Seeded)
.choice_olympus("defect");
let game_options = game_options_builder.unwrap().build();
§CustomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Customized)
.choice_olympus("defect");
let game_options = game_options_builder.unwrap().build();
§Errors
This function will return an error if the choice_olympus argument is
empty.
§Returns
The GameOptionsBuilder struct with the choice_olympus field set.
§See Also
GameOptionsBuilder::new()GameOptionsBuilder::build()GameOptionsBuilder::max_value()GameOptionsBuilder::min_value()GameOptionsBuilder::choice_atlantis()GameOptionsBuilder::atlantis_atlantis()GameOptionsBuilder::atlantis_olympus()GameOptionsBuilder::olympus_atlantis()GameOptionsBuilder::olympus_olympus()GameOptionsBuilder::seed()
Sourcepub fn atlantis_atlantis(
self,
atlantis_atlantis: NumberPair,
) -> Result<Self, BuilderError>
pub fn atlantis_atlantis( self, atlantis_atlantis: NumberPair, ) -> Result<Self, BuilderError>
Sets the score for the case when both players (Aleph and Beth) choose the first (Atlantis) choice.
This function sets the score for the case when both players choose the
first (Atlantis) choice. This function is only valid for the
GameOptionsBuilderTypes::Customized
variant of the GameOptionsBuilder struct.
§Arguments
atlantis_atlantis- The score to set.
§Example
§RandomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
NumberPair,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Randomized)
.atlantis_atlantis(NumberPair::new(4, 4));§SeededBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
NumberPair,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Seeded)
.atlantis_atlantis(NumberPair::new(4, 4));§CustomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
NumberPair,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Customized)
.atlantis_atlantis(NumberPair::new(4, 4));
let game_options = game_options_builder.unwrap().build();
§Errors
This function will return an error if the builder_type is
GameOptionsBuilderTypes::Randomized
or GameOptionsBuilderTypes::Seeded.
§Returns
The GameOptionsBuilder struct with the atlantis_atlantis field set.
§See Also
GameOptionsBuilder::new()GameOptionsBuilder::build()GameOptionsBuilder::max_value()GameOptionsBuilder::min_value()GameOptionsBuilder::choice_atlantis()GameOptionsBuilder::choice_olympus()GameOptionsBuilder::atlantis_olympus()GameOptionsBuilder::olympus_atlantis()GameOptionsBuilder::olympus_olympus()GameOptionsBuilder::seed()
Sourcepub fn atlantis_olympus(
self,
atlantis_olympus: NumberPair,
) -> Result<Self, BuilderError>
pub fn atlantis_olympus( self, atlantis_olympus: NumberPair, ) -> Result<Self, BuilderError>
Sets the score for the case when Player Aleph chooses the first (Atlantis) choice and Player Beth chooses the second (Olympus) choice.
This function sets the score for the case when Player Aleph chooses the
first (Atlantis) choice and Player Beth chooses the second (Olympus)
choice. This function is only valid for the
GameOptionsBuilderTypes::Customized
variant of the GameOptionsBuilder struct.
§Arguments
atlantis_olympus- The score to set.
§Example
§RandomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
NumberPair,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Randomized)
.atlantis_olympus(NumberPair::new(0, 5));§SeededBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
NumberPair,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Seeded)
.atlantis_olympus(NumberPair::new(0, 5));§CustomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
NumberPair,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Customized)
.atlantis_olympus(NumberPair::new(0, 5));
let game_options = game_options_builder.unwrap().build();
§Errors
This function will return an error if the builder_type is
GameOptionsBuilderTypes::Randomized
or GameOptionsBuilderTypes::Seeded.
§Returns
The GameOptionsBuilder struct with the atlantis_olympus field set.
§See Also
GameOptionsBuilder::new()GameOptionsBuilder::build()GameOptionsBuilder::max_value()GameOptionsBuilder::min_value()GameOptionsBuilder::choice_atlantis()GameOptionsBuilder::choice_olympus()GameOptionsBuilder::atlantis_atlantis()GameOptionsBuilder::olympus_atlantis()GameOptionsBuilder::olympus_olympus()GameOptionsBuilder::seed()
Sourcepub fn olympus_atlantis(
self,
olympus_atlantis: NumberPair,
) -> Result<Self, BuilderError>
pub fn olympus_atlantis( self, olympus_atlantis: NumberPair, ) -> Result<Self, BuilderError>
Sets the score for the case when Player Aleph chooses the second choice and Player Beth chooses the first choice.
This function sets the score for the case when Player Aleph chooses the
second (Olympus) choice and Player Beth chooses the first (Atlantis)
choice. This function is only valid for the
GameOptionsBuilderTypes::Customized
variant of the GameOptionsBuilder struct.
§Arguments
olympus_atlantis- The score to set.
§Example
§RandomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
NumberPair,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Randomized)
.olympus_atlantis(NumberPair::new(5, 0));
§SeededBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
NumberPair,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Seeded)
.olympus_atlantis(NumberPair::new(5, 0));
§CustomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
NumberPair,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Customized)
.olympus_atlantis(NumberPair::new(5, 0));
let game_options = game_options_builder.unwrap().build();
§Errors
This function will return an error if the builder_type is
GameOptionsBuilderTypes::Randomized
or GameOptionsBuilderTypes::Seeded.
§Returns
The GameOptionsBuilder struct with the olympus_atlantis field set.
§See Also
GameOptionsBuilder::new()GameOptionsBuilder::build()GameOptionsBuilder::max_value()GameOptionsBuilder::min_value()GameOptionsBuilder::choice_atlantis()GameOptionsBuilder::choice_olympus()GameOptionsBuilder::atlantis_atlantis()GameOptionsBuilder::atlantis_olympus()GameOptionsBuilder::olympus_olympus()GameOptionsBuilder::seed()
Sourcepub fn olympus_olympus(
self,
olympus_olympus: NumberPair,
) -> Result<Self, BuilderError>
pub fn olympus_olympus( self, olympus_olympus: NumberPair, ) -> Result<Self, BuilderError>
Sets the score for the case when both players (Aleph and Beth) choose the second (Olympus) choice.
This function sets the score for the case when both players choose the
second (Olympus) choice. This function is only valid for the
GameOptionsBuilderTypes::Customized
variant of the GameOptionsBuilder struct.
§Arguments
olympus_olympus- The score to set.
§Example
§RandomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
NumberPair,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Randomized)
.olympus_olympus(NumberPair::new(3, 3));
§SeededBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
NumberPair,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Seeded)
.olympus_olympus(NumberPair::new(3, 3));
§CustomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
NumberPair,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Customized)
.olympus_olympus(NumberPair::new(3, 3));
let game_options = game_options_builder.unwrap().build();
§Errors
This function will return an error if the builder_type is
GameOptionsBuilderTypes::Randomized
or GameOptionsBuilderTypes::Seeded.
§Returns
The GameOptionsBuilder struct with the olympus_olympus field set.
§See Also
GameOptionsBuilder::new()GameOptionsBuilder::build()GameOptionsBuilder::max_value()GameOptionsBuilder::min_value()GameOptionsBuilder::choice_atlantis()GameOptionsBuilder::choice_olympus()GameOptionsBuilder::atlantis_atlantis()GameOptionsBuilder::atlantis_olympus()GameOptionsBuilder::olympus_atlantis()GameOptionsBuilder::seed()
Sourcepub fn seed(self, seed: u64) -> Result<Self, BuilderError>
pub fn seed(self, seed: u64) -> Result<Self, BuilderError>
Sets the seed for the GameOptions.
This function sets the seed for the GameOptions struct that is being
built. This function is only valid for the
GameOptionsBuilderTypes::Seeded
variant of the GameOptionsBuilder struct.
§Arguments
seed- The seed for theGameOptions.
§Example
§RandomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Randomized)
.seed(123456789);
§SeededBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Seeded)
.seed(123456789);
§CustomizedBuilder
use dilemma_tactix_lib::{
GameOptionsBuilder,
GameOptionsBuilderTypes,
};
let game_options_builder =
GameOptionsBuilder::new(GameOptionsBuilderTypes::Customized)
.seed(123456789);
§Errors
This function will return an error if the builder_type is
GameOptionsBuilderTypes::Randomized
or GameOptionsBuilderTypes::Customized.
§Returns
The GameOptionsBuilder struct with the seed field set.
§See Also
GameOptionsBuilder::new()GameOptionsBuilder::build()GameOptionsBuilder::max_value()GameOptionsBuilder::min_value()GameOptionsBuilder::choice_atlantis()GameOptionsBuilder::choice_olympus()GameOptionsBuilder::atlantis_atlantis()GameOptionsBuilder::atlantis_olympus()GameOptionsBuilder::olympus_atlantis()GameOptionsBuilder::olympus_olympus()
Sourcepub fn build(self) -> GameOptions
pub fn build(self) -> GameOptions
Builds the GameOptions struct.
§Returns
A new GameOptions struct.
§Panics
This function will panic if any of the required fields are not set.
§See Also
GameOptionsBuilder::new()GameOptionsBuilder::max_value()GameOptionsBuilder::min_value()GameOptionsBuilder::choice_atlantis()GameOptionsBuilder::choice_olympus()GameOptionsBuilder::atlantis_atlantis()GameOptionsBuilder::atlantis_olympus()GameOptionsBuilder::olympus_atlantis()GameOptionsBuilder::olympus_olympus()
Trait Implementations§
Source§impl Clone for GameOptionsBuilder
impl Clone for GameOptionsBuilder
Source§fn clone(&self) -> GameOptionsBuilder
fn clone(&self) -> GameOptionsBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more