pub fn player(ecs: &mut World, player_x: i32, player_y: i32) -> Entity {
    let entity = 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(Player {})
        .with(Viewshed { visible_tiles: Vec::new(), range: 8, dirty: true })
        .with(Name { name: "Player".to_string() })
        .with(CombatStats {
            max_hp: 30,
            hp: 30,
            stamina: 10,
            max_stamina: 10,
            defense: 2,
            power: 2,
        })
        .with(Attributes {
            strength: Attribute { base: 10, modifiers: 0, bonus: 0 },
            dexterity: Attribute { base: 10, modifiers: 0, bonus: 0 },
            endurance: Attribute { base: 10, modifiers: 0, bonus: 0 },
        })
        .marked::<SimpleMarker<SerializeMe>>()
        .build();

    //    let (x, y) = find_empty_adjacent(ecs, player_x, player_y);
    //    weapon_entity(ecs, x, y, entity);

    entity
}
/// Spawns the player and returns their entity object.
Spawns the player and returns their entity object.
Spawns the player and returns their entity object .
pub fn player(ecs: &mut World, player_x: i32, player_y: i32) -> Entity {
    let entity = 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(Player {})
        .with(Viewshed { visible_tiles: Vec::new(), range: 8, dirty: true })
        .with(Name { name: "Player".to_string() })
        .with(CombatStats {
            max_hp: 30,
            hp: 30,
            stamina: 10,
            max_stamina: 10,
            defense: 2,
            power: 2,
        })
        .with(Attributes {
            strength: Attribute { base: 10, modifiers: 0, bonus: 0 },
            dexterity: Attribute { base: 10, modifiers: 0, bonus: 0 },
            endurance: Attribute { base: 10, modifiers: 0, bonus: 0 },
        })
        .marked::<SimpleMarker<SerializeMe>>()
        .build();
    //    let (x, y) = find_empty_adjacent(ecs, player_x, player_y);
    //    weapon_entity(ecs, x, y, entity);
    entity
}
pub fn player ( ecs : & mut World , player_x : i32 , player_y : i32 ) -> Entity { let entity = 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 ( Player { } ) . with ( Viewshed { visible_tiles : Vec :: new ( ) , range : 8 , dirty : true } ) . with ( Name { name : " " . to_string ( ) } ) . with ( CombatStats { max_hp : 30 , hp : 30 , stamina : 10 , max_stamina : 10 , defense : 2 , power : 2 , } ) . with ( Attributes { strength : Attribute { base : 10 , modifiers : 0 , bonus : 0 } , dexterity : Attribute { base : 10 , modifiers : 0 , bonus : 0 } , endurance : Attribute { base : 10 , modifiers : 0 , bonus : 0 } , } ) . marked :: < SimpleMarker < SerializeMe > > ( ) . build ( ) ; //    let (x, y) = find_empty_adjacent(ecs, player_x, player_y); //    weapon_entity(ecs, x, y, entity); entity }
Spawns the player and returns their entity object.
Spawns the player and returns their entity object .
ecs
&mut World
player_x
i32
player_y
i32