[][src]Struct genie_dat::DatFile

pub struct DatFile {
    pub terrain_tables: Vec<TerrainRestriction>,
    pub tile_sizes: Vec<TileSize>,
    pub terrains: Vec<Terrain>,
    pub terrain_borders: Vec<TerrainBorder>,
    pub color_tables: Vec<ColorTable>,
    pub sounds: Vec<Sound>,
    pub sprites: Vec<Option<Sprite>>,
    pub effects: Vec<TechEffect>,
    pub task_lists: Vec<Option<TaskList>>,
    pub civilizations: Vec<Civilization>,
    pub techs: Vec<Tech>,
    pub tech_tree: TechTree,
    // some fields omitted
}

A data file.

Fields

terrain_tables: Vec<TerrainRestriction>

Terrain restriction tables.

tile_sizes: Vec<TileSize>

Tile size data.

terrains: Vec<Terrain>

Terrains.

terrain_borders: Vec<TerrainBorder>

Terrain border data, specifying how different terrains blend.

color_tables: Vec<ColorTable>

Data about player colours.

sounds: Vec<Sound>

The available sounds.

sprites: Vec<Option<Sprite>>

The available sprites.

effects: Vec<TechEffect>

Tech effect data.

task_lists: Vec<Option<TaskList>>

Task lists for unit types.

civilizations: Vec<Civilization>

The available civilizations.

techs: Vec<Tech>

Techs or researches.

tech_tree: TechTree

Tech tree data.

Implementations

impl DatFile[src]

pub fn read_from(input: impl Read) -> Result<Self>[src]

Read a data file from a compressed byte stream.

pub fn write_to<W: Write>(&self, output: &mut W) -> Result<()>[src]

Serialize this data file to an output stream. Compression is applied by this function.

pub fn get_tech(&self, id: impl Into<TechID>) -> Option<&Tech>[src]

Get a tech by its ID.

pub fn get_terrain(&self, id: impl Into<TerrainID>) -> Option<&Terrain>[src]

Get a terrain type by its ID.

pub fn get_gaia(&self) -> Option<&Civilization>[src]

Get the GAIA civilization.

pub fn get_civilization(
    &self,
    id: impl Into<CivilizationID>
) -> Option<&Civilization>
[src]

Get a civilization by its ID.

pub fn get_sound(&self, id: impl Into<SoundID>) -> Option<&Sound>[src]

Get a sound by its ID.

pub fn get_sprite(&self, id: impl Into<SpriteID>) -> Option<&Sprite>[src]

Get a sprite by its ID.

Trait Implementations

impl Clone for DatFile[src]

impl Debug for DatFile[src]

Auto Trait Implementations

impl RefUnwindSafe for DatFile

impl Send for DatFile

impl Sync for DatFile

impl Unpin for DatFile

impl UnwindSafe for DatFile

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.