pub struct Data {}Expand description
An interface that provides a centralized location for storing and accessing game-related data.
Implementations§
Source§impl Data
impl Data
Sourcepub fn get_group_first_player() -> i32
pub fn get_group_first_player() -> i32
Gets the group key representing the first index for a player group.
Sourcepub fn get_group_last_player() -> i32
pub fn get_group_last_player() -> i32
Gets the group key representing the last index for a player group.
Sourcepub fn get_group_hide() -> i32
pub fn get_group_hide() -> i32
Gets the group key that won’t have any contact with other groups by default.
Sourcepub fn get_group_detect_player() -> i32
pub fn get_group_detect_player() -> i32
Gets the group key that will have contacts with player groups by default.
Sourcepub fn get_group_terrain() -> i32
pub fn get_group_terrain() -> i32
Gets the group key representing terrain that will have contacts with other groups by default.
Sourcepub fn get_group_detection() -> i32
pub fn get_group_detection() -> i32
Gets the group key that will have contacts with other groups by default.
Sourcepub fn get_store() -> Dictionary
pub fn get_store() -> Dictionary
Gets the dictionary that can be used to store arbitrary data associated with string keys and various values globally.
Sourcepub fn set_should_contact(group_a: i32, group_b: i32, contact: bool)
pub fn set_should_contact(group_a: i32, group_b: i32, contact: bool)
Sets a boolean value indicating whether two groups should be in contact or not.
§Arguments
group_a- An integer representing the first group.group_b- An integer representing the second group.contact- A boolean indicating whether the two groups should be in contact.
Sourcepub fn get_should_contact(group_a: i32, group_b: i32) -> bool
pub fn get_should_contact(group_a: i32, group_b: i32) -> bool
Sourcepub fn set_relation(group_a: i32, group_b: i32, relation: Relation)
pub fn set_relation(group_a: i32, group_b: i32, relation: Relation)
Sets the relation between two groups.
§Arguments
group_a- An integer representing the first group.group_b- An integer representing the second group.relation- The relation between the two groups.
Sourcepub fn get_relation_by_group(group_a: i32, group_b: i32) -> Relation
pub fn get_relation_by_group(group_a: i32, group_b: i32) -> Relation
Sourcepub fn get_relation(body_a: &dyn IBody, body_b: &dyn IBody) -> Relation
pub fn get_relation(body_a: &dyn IBody, body_b: &dyn IBody) -> Relation
Sourcepub fn is_enemy_group(group_a: i32, group_b: i32) -> bool
pub fn is_enemy_group(group_a: i32, group_b: i32) -> bool
Sourcepub fn is_friend_group(group_a: i32, group_b: i32) -> bool
pub fn is_friend_group(group_a: i32, group_b: i32) -> bool
Sourcepub fn is_neutral_group(group_a: i32, group_b: i32) -> bool
pub fn is_neutral_group(group_a: i32, group_b: i32) -> bool
Sourcepub fn is_neutral(body_a: &dyn IBody, body_b: &dyn IBody) -> bool
pub fn is_neutral(body_a: &dyn IBody, body_b: &dyn IBody) -> bool
Sourcepub fn set_damage_factor(damage_type: i32, defence_type: i32, bounus: f32)
pub fn set_damage_factor(damage_type: i32, defence_type: i32, bounus: f32)
Sets the bonus factor for a particular type of damage against a particular type of defence.
The builtin “MeleeAttack” and “RangeAttack” actions use a simple formula of finalDamage = damage * bonus.
§Arguments
damage_type- An integer representing the type of damage.defence_type- An integer representing the type of defence.bonus- A number representing the bonus.