pub fn player(ecs: &mut World, player_x: i32, player_y: i32) -> Entity {
    let fireball_known_spell: KnownSpell;
    {
        fireball_known_spell = fireball(ecs);
    }
    ecs.create_entity()
        .with(Position {
            x: player_x,
            y: player_y,
        })
        .with(Renderable {
            glyph: rltk::to_cp437('@'),
            fg: RGB::named(rltk::YELLOW),
            bg: RGB::named(rltk::BLACK),
            render_order: 0,
        })
        .with(MagicStats {
            max_mana: 10,
            mana: 10,
        })
        .with(Player {})
        .with(Viewshed {
            visible_tiles: Vec::new(),
            range: 8,
            dirty: true,
        })
        .with(KnownSpells {
            spells: vec![fireball_known_spell],
        })
        .with(Name {
            name: "Player".to_string(),
        })
        .with(CombatStats {
            max_hp: 30,
            hp: 30,
            defense: 2,
            power: 5,
        })
        .marked::<SimpleMarker<SerializeMe>>()
        .build()
}
/// Spawns the player and returns his/her entity object.
Spawns the player and returns his/her entity object.
Spawns the player and returns his / her entity object .
pub fn player(ecs: &mut World, player_x: i32, player_y: i32) -> Entity {
    let fireball_known_spell: KnownSpell;
    {
        fireball_known_spell = fireball(ecs);
    }
    ecs.create_entity()
        .with(Position {
            x: player_x,
            y: player_y,
        })
        .with(Renderable {
            glyph: rltk::to_cp437('@'),
            fg: RGB::named(rltk::YELLOW),
            bg: RGB::named(rltk::BLACK),
            render_order: 0,
        })
        .with(MagicStats {
            max_mana: 10,
            mana: 10,
        })
        .with(Player {})
        .with(Viewshed {
            visible_tiles: Vec::new(),
            range: 8,
            dirty: true,
        })
        .with(KnownSpells {
            spells: vec![fireball_known_spell],
        })
        .with(Name {
            name: "Player".to_string(),
        })
        .with(CombatStats {
            max_hp: 30,
            hp: 30,
            defense: 2,
            power: 5,
        })
        .marked::<SimpleMarker<SerializeMe>>()
        .build()
}
pub fn player ( ecs : & mut World , player_x : i32 , player_y : i32 ) -> Entity { let fireball_known_spell : KnownSpell ; { fireball_known_spell = fireball ( ecs ) ; } ecs . create_entity ( ) . with ( Position { x : player_x , y : player_y , } ) . with ( Renderable { glyph : rltk :: to_cp437 ( '@' ) , fg : RGB :: named ( rltk :: YELLOW ) , bg : RGB :: named ( rltk :: BLACK ) , render_order : 0 , } ) . with ( MagicStats { max_mana : 10 , mana : 10 , } ) . with ( Player { } ) . with ( Viewshed { visible_tiles : Vec :: new ( ) , range : 8 , dirty : true , } ) . with ( KnownSpells { spells : vec ! [ fireball_known_spell ] , } ) . with ( Name { name : " " . to_string ( ) , } ) . with ( CombatStats { max_hp : 30 , hp : 30 , defense : 2 , power : 5 , } ) . marked :: < SimpleMarker < SerializeMe > > ( ) . build ( ) }
Spawns the player and returns his/her entity object.
Spawns the player and returns his / her entity object .
ecs
&mut World
player_x
i32
player_y
i32