Struct rpg::world::two_dimensional::Field
[−]
[src]
pub struct Field { pub field_type: FieldType, pub height: i32, pub contained_entity_id: Option<usize>, }
A single field of the world
Fields
field_type: FieldType
The type of the field
height: i32
The height of the field. Used for collision detection
contained_entity_id: Option<usize>
The id if the contained entity (optional)
Methods
impl Field
[src]
fn new(field_type: FieldType) -> Field
Creates a new instance of Field
fn contained_entity_id(self, entity_id: usize) -> Field
A builder method for adding an entity to a field
fn height(self, height: i32) -> Field
A builder method for setting the height of a field
Trait Implementations
impl Encodable for Field
[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
Serialize a value using an Encoder
.
impl Decodable for Field
[src]
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Field, __D::Error>
Deserialize a value using a Decoder
.
impl Clone for Field
[src]
fn clone(&self) -> Field
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more