Use rltk prelude import instead of full paths
This commit is contained in:
parent
fd9f8e7463
commit
30de2cd7ce
@ -1,6 +1,6 @@
|
||||
//! Color constants to replace more verbose methods of defining colors in the game.
|
||||
//! These constants replace the `::rltk::RGB` constructor functions
|
||||
use ::rltk::RGB;
|
||||
use ::rltk::prelude::*;
|
||||
|
||||
const fn new(r: f32, g: f32, b: f32) -> RGB {
|
||||
RGB { r, g, b }
|
||||
|
@ -5,7 +5,7 @@ mod tags;
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
use ::rltk::{FontCharType, Point, RGB};
|
||||
use ::rltk::prelude::*;
|
||||
use ::serde::{Deserialize, Serialize};
|
||||
use ::specs::error::NoError;
|
||||
use ::specs::prelude::*;
|
||||
|
@ -9,7 +9,7 @@ mod triggers;
|
||||
use std::collections::{HashSet, VecDeque};
|
||||
use std::sync::Mutex;
|
||||
|
||||
use ::rltk::{FontCharType, Point, RGB};
|
||||
use ::rltk::prelude::*;
|
||||
use ::specs::prelude::*;
|
||||
pub use targeting::*;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use ::rltk::Point;
|
||||
use ::rltk::prelude::*;
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use super::{add_effect, EffectType, Targets};
|
||||
@ -349,8 +349,6 @@ fn event_trigger(
|
||||
}
|
||||
|
||||
fn spawn_line_particles(ecs: &World, start: i32, end: i32, part: &SpawnParticleLine) {
|
||||
use ::rltk::LineAlg;
|
||||
|
||||
let map = ecs.fetch::<Map>();
|
||||
let start_pt = Point::new(start % map.width, end / map.width);
|
||||
let end_pt = Point::new(end % map.width, end / map.width);
|
||||
|
@ -5,7 +5,7 @@ mod builder;
|
||||
mod events;
|
||||
mod logstore;
|
||||
|
||||
use ::rltk::RGB;
|
||||
use ::rltk::prelude::*;
|
||||
use ::serde::{Deserialize, Serialize};
|
||||
pub use builder::*;
|
||||
pub use events::*;
|
||||
|
@ -1,5 +1,4 @@
|
||||
use ::rltk::prelude::*;
|
||||
use ::rltk::{Rltk, VirtualKeyCode};
|
||||
|
||||
use super::{menu_box, menu_option};
|
||||
use crate::{colors, State};
|
||||
|
@ -1,5 +1,4 @@
|
||||
use ::rltk::prelude::*;
|
||||
use ::rltk::Rltk;
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use super::{get_item_display_name, item_result_menu, ItemMenuResult};
|
||||
|
@ -1,7 +1,6 @@
|
||||
use std::cmp::Ordering;
|
||||
|
||||
use ::rltk::prelude::*;
|
||||
use ::rltk::{Point, Rltk};
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use super::{draw_tooltips, get_item_color, get_item_display_name};
|
||||
|
@ -1,5 +1,4 @@
|
||||
use ::rltk::prelude::*;
|
||||
use ::rltk::Rltk;
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use super::{get_item_display_name, item_result_menu, ItemMenuResult};
|
||||
|
@ -1,5 +1,4 @@
|
||||
use ::rltk::prelude::*;
|
||||
use ::rltk::Rltk;
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use super::{get_item_display_name, item_result_menu, ItemMenuResult};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use ::rltk::RGB;
|
||||
use ::rltk::prelude::*;
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use crate::components::{Consumable, CursedItem, MagicItem, MagicItemClass, Name, ObfuscatedName};
|
||||
|
@ -1,5 +1,4 @@
|
||||
use ::rltk::prelude::*;
|
||||
use ::rltk::{DistanceAlg, Point, Rltk};
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use super::ItemMenuResult;
|
||||
|
@ -1,5 +1,4 @@
|
||||
use ::rltk::prelude::*;
|
||||
use ::rltk::Rltk;
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use super::{get_item_display_name, item_result_menu, ItemMenuResult};
|
||||
|
@ -1,5 +1,4 @@
|
||||
use ::rltk::prelude::*;
|
||||
use ::rltk::Rltk;
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use super::{get_item_display_name, item_result_menu, ItemMenuResult};
|
||||
|
@ -25,6 +25,7 @@ mod spawner;
|
||||
mod state;
|
||||
mod systems;
|
||||
|
||||
use ::rltk::prelude::*;
|
||||
use ::specs::prelude::*;
|
||||
use ::specs::saveload::{SimpleMarker, SimpleMarkerAllocator};
|
||||
use components::*;
|
||||
@ -154,7 +155,6 @@ fn register_components(state: &mut State) {
|
||||
/// * Creates the [`Player`](crate::spawner::player)
|
||||
/// * Generates the first [`map`](crate::state::State::generate_world_map)
|
||||
fn init_state() -> State {
|
||||
use ::rltk::Point;
|
||||
use systems::particle_system::ParticleBuilder;
|
||||
|
||||
let mut state = State::new();
|
||||
@ -185,8 +185,6 @@ fn init_state() -> State {
|
||||
|
||||
/// The entry point
|
||||
fn main() -> ::rltk::BError {
|
||||
use ::rltk::{main_loop, RltkBuilder};
|
||||
|
||||
let context = RltkBuilder::simple(80, 60)
|
||||
.unwrap()
|
||||
.with_title("Roguelike Tutorial")
|
||||
|
@ -6,7 +6,7 @@ mod tiletype;
|
||||
|
||||
use std::collections::HashSet;
|
||||
|
||||
use ::rltk::{Algorithm2D, BaseMap, Point, SmallVec, RGB};
|
||||
use ::rltk::prelude::*;
|
||||
use ::serde::{Deserialize, Serialize};
|
||||
pub use dungeon::*;
|
||||
pub use themes::*;
|
||||
|
@ -1,6 +1,5 @@
|
||||
//! Handle rendering of the viewport
|
||||
use ::rltk::prelude::*;
|
||||
use ::rltk::{Point, Rltk};
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use crate::components::{Hidden, Position, Renderable, Target, TileSize};
|
||||
|
@ -1,5 +1,5 @@
|
||||
//! Different looks for the same set of [`TileType`]s
|
||||
use ::rltk::{to_cp437, FontCharType, RGB};
|
||||
use ::rltk::prelude::*;
|
||||
|
||||
use super::{Map, TileType};
|
||||
use crate::colors;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use ::rltk::{DistanceAlg, Point};
|
||||
use ::rltk::prelude::*;
|
||||
|
||||
use super::{BuilderMap, MetaMapBuilder};
|
||||
use crate::{map, TileType};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use ::rltk::{DistanceAlg, Point};
|
||||
use ::rltk::prelude::*;
|
||||
|
||||
use super::{
|
||||
AreaEndingPosition, AreaStartingPosition, BspCorridors, BspDungeonBuilder, BuilderChain,
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use ::rltk::{CellularDistanceFunction, FastNoise, NoiseType};
|
||||
use ::rltk::prelude::*;
|
||||
|
||||
use crate::map_builders::{BuilderMap, MetaMapBuilder};
|
||||
use crate::rng::roll_dice;
|
||||
|
@ -1,8 +1,8 @@
|
||||
//! Player-related functionality
|
||||
use std::cmp::{max, min};
|
||||
|
||||
use rltk::{DistanceAlg, Point, Rltk, VirtualKeyCode};
|
||||
use specs::prelude::*;
|
||||
use ::rltk::prelude::*;
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use crate::components::{
|
||||
Attributes, BlocksTile, BlocksVisibility, Door, EntityMoved, Equipped, Faction, HungerClock,
|
||||
|
@ -11,7 +11,7 @@ mod weapon_traits;
|
||||
|
||||
use std::sync::Mutex;
|
||||
|
||||
use ::rltk::{embedded_resource, link_resource};
|
||||
use ::rltk::prelude::*;
|
||||
use ::serde::Deserialize;
|
||||
pub use faction_structs::*;
|
||||
use item_structs::*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
use ::regex::Regex;
|
||||
use ::rltk::{console, RGB};
|
||||
use ::rltk::prelude::*;
|
||||
use ::specs::prelude::*;
|
||||
use ::specs::saveload::{MarkedBuilder, SimpleMarker};
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
use ::rltk::prelude::*;
|
||||
use ::rltk::rex::XpFile;
|
||||
use ::rltk::{embedded_resource, link_resource};
|
||||
|
||||
embedded_resource!(SMALL_DUNGEON, "../resources/SmallDungeon_80x50.xp");
|
||||
embedded_resource!(WFC_DEMO_IMAGE1, "../resources/wfc-demo1.xp");
|
||||
|
@ -1,5 +1,5 @@
|
||||
//! Game state
|
||||
use ::rltk::{GameState, Point, Rltk};
|
||||
use ::rltk::prelude::*;
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use crate::components::*;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use ::rltk::a_star_search;
|
||||
use ::rltk::prelude::*;
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use crate::components::{ApplyMove, MyTurn, Position, WantsToApproach};
|
||||
|
@ -1,5 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use ::rltk::prelude::*;
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use crate::components::{ApplyMove, Chasing, MyTurn, Position, TileSize};
|
||||
@ -20,8 +21,6 @@ impl<'a> System<'a> for ChaseAI {
|
||||
);
|
||||
|
||||
fn run(&mut self, data: Self::SystemData) {
|
||||
use ::rltk::a_star_search;
|
||||
|
||||
let (mut turns, mut chasing, positions, map, entities, mut apply_move, sizes) = data;
|
||||
|
||||
let mut targets: HashMap<Entity, (i32, i32)> = HashMap::new();
|
||||
|
@ -1,4 +1,4 @@
|
||||
use ::rltk::DijkstraMap;
|
||||
use ::rltk::prelude::*;
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use crate::components::{ApplyMove, MyTurn, Position, WantsToFlee};
|
||||
|
@ -1,6 +1,5 @@
|
||||
use ::rltk::Point;
|
||||
use ::rltk::prelude::*;
|
||||
use ::specs::prelude::*;
|
||||
use rltk::DistanceAlg;
|
||||
|
||||
use crate::components::{LightSource, Position, Viewshed};
|
||||
use crate::{colors, Map};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use ::rltk::{Rltk, RGB};
|
||||
use ::rltk::prelude::*;
|
||||
use ::specs::prelude::*;
|
||||
|
||||
use crate::components::{ParticleLifetime, Position, Renderable};
|
||||
|
Loading…
Reference in New Issue
Block a user