Skip to content

Commit

Permalink
Cargo fix go brrrr.
Browse files Browse the repository at this point in the history
  • Loading branch information
InfinityDevTech committed Sep 30, 2024
1 parent 482e1a9 commit 4a4da9e
Show file tree
Hide file tree
Showing 19 changed files with 18 additions and 32 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
name = "crustacean"
version = "0.0.0"
authors = []
target_family = "wasm"
edition = "2021"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion src/combat/safemode.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashMap;

use screeps::{find, game, HasHits, HasPosition, LocalCostMatrix, Room, RoomXY, Terrain};
use screeps::{find, game, HasHits, HasPosition, LocalCostMatrix, Room, Terrain};

use crate::{constants, memory::ScreepsMemory, room::cache::CachedRoom, traits::{position::PositionExtensions, room::find_pos_in_rect}, utils};

Expand Down
1 change: 0 additions & 1 deletion src/combat/setters/remote_defense.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use log::info;
use screeps::{game, Part, SharedCreepProperties};

use crate::{allies, combat::goals::determine_single_attack_power, constants::{self, HOSTILE_PARTS}, goal_memory::{AttackingCreep, RemoteDefenseGoal}, memory::ScreepsMemory, room::cache::RoomCache};
Expand Down
4 changes: 2 additions & 2 deletions src/heap_cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

use std::{collections::HashMap, sync::Mutex};

use crate::{compression::compressed_matrix::CompressedMatrix, movement::move_target::MoveOptions};
use crate::compression::compressed_matrix::CompressedMatrix;
use hauling::HeapHaulingCache;
use heap_creep::HeapCreep;
use heap_room::HeapRoom;
use screeps::{game, LocalCostMatrix, Position, RoomName};
use screeps::{game, Position, RoomName};

use crate::memory::ScreepsMemory;

Expand Down
7 changes: 3 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ use formation::formations::run_formations;
use heap_cache::GlobalHeapCache;
use log::*;
use memory::Role;
use movement::{caching::generate_pathing_targets, move_target::{path_call, MoveOptions}};
use movement::caching::generate_pathing_targets;
use profiling::timing::{INTENTS_USED, PATHFIND_CPU, SUBTRACT_INTENTS};
use rand::{rngs::StdRng, Rng, SeedableRng};
use room::{
cache::{self, hauling, traffic, RoomCache}, creeps::local::hauler::check_relay, democracy::start_government, expansion::{attempt_expansion, can_expand}, spawning::spawn_manager::{self, run_spawning, SpawnManager}, visuals::visualise_scouted_rooms
cache::{hauling, traffic, RoomCache}, democracy::start_government, expansion::{attempt_expansion, can_expand}, spawning::spawn_manager::{self, run_spawning, SpawnManager}, visuals::visualise_scouted_rooms
};
use screeps::{find, game, pathfinder::{self, SearchOptions}, CircleStyle, OwnedStructureProperties, Position, RoomCoordinate, RoomName};
use screeps::{find, game, OwnedStructureProperties};
use traits::{creep::CreepExtensions, intents_tracking::{
ConstructionExtensionsTracking, CreepExtensionsTracking, StructureControllerExtensionsTracking,
StructureObjectTracking,
Expand All @@ -30,7 +30,6 @@ use wasm_bindgen::prelude::*;

use crate::{memory::ScreepsMemory, traits::room::RoomExtensions};

use talc::*;

#[global_allocator]
static ALLOCATOR: talc::Talck<talc::locking::AssumeUnlockable, talc::ClaimOnOom> = unsafe {
Expand Down
5 changes: 2 additions & 3 deletions src/movement/move_target.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::{borrow::BorrowMut, collections::HashMap};

use log::{info, warn};
use log::warn;
use screeps::{
find, game,
pathfinder::{self, MultiRoomCostResult, SearchOptions, SearchResults},
Expand All @@ -10,7 +9,7 @@ use screeps::{
use screeps_utils::room_xy::{chebyshev_range_iter, GridIter, Order};

use crate::{
constants::{SWAMP_MASK, WALL_MASK}, heap, memory::ScreepsMemory, profiling::timing::PATHFIND_CPU, traits::position::RoomXYExtensions, utils::{self, get_my_username, new_xy}
constants::{SWAMP_MASK, WALL_MASK}, memory::ScreepsMemory, profiling::timing::PATHFIND_CPU, utils::{self, get_my_username}
};

use super::movement_utils::visualise_path;
Expand Down
2 changes: 1 addition & 1 deletion src/room/cache/hauling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ pub fn clean_heap_hauling(memory: &mut ScreepsMemory) {
let mut lock = heap().hauling.lock().unwrap();

for hauling_order in lock.reserved_orders.values_mut() {
let mut game_obj = game::get_object_by_id_erased(&hauling_order.target_id);
let game_obj = game::get_object_by_id_erased(&hauling_order.target_id);
let mut removed = Vec::new();
// Remove creeps that are dead or have no task assigned
// Then add them to the ^^^^^ removed list, so we can calculate carry parts.
Expand Down
2 changes: 0 additions & 2 deletions src/room/cache/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use screeps::{
find, game, look::{self, LookResult}, ConstructionSite, RoomName, Creep, HasId, HasPosition, MapTextStyle, MapVisual, MaybeHasId, Mineral, ObjectId, Part, Position, Resource, ResourceType, Room, RoomCoordinate, RoomXY, SharedCreepProperties, Source, StructureContainer, StructureLink, StructureProperties, StructureType, Terrain
};

#[cfg(feature = "season1")]
use screeps::resource::ResourceType::Score;
#[cfg(feature = "season1")]
use screeps::ScoreContainer;

Expand Down
1 change: 0 additions & 1 deletion src/room/creeps/global/scout.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use log::info;
use rand::rngs::StdRng;
use rand::seq::SliceRandom;
use rand::SeedableRng;
Expand Down
2 changes: 1 addition & 1 deletion src/room/creeps/local/builder.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use screeps::{
ConstructionSite, Creep, HasPosition, MaybeHasId, Part, Position, ResourceType, RoomCoordinate, RoomName, SharedCreepProperties
ConstructionSite, Creep, HasPosition, Part, Position, ResourceType, RoomCoordinate, RoomName, SharedCreepProperties
};

use crate::{
Expand Down
1 change: 0 additions & 1 deletion src/room/creeps/local/fast_filler.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use log::info;
use screeps::{
game, look, Creep, HasId, HasPosition, MaybeHasId, ObjectId, RawObjectId, ResourceType,
RoomPosition, RoomXY, SharedCreepProperties, StructureContainer, StructureExtension,
Expand Down
1 change: 0 additions & 1 deletion src/room/creeps/local/hauler.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::cmp;

use js_sys::JsString;
use screeps::{
Expand Down
4 changes: 2 additions & 2 deletions src/room/creeps/season1/digger.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{cmp, collections::HashMap, hash::Hash};
use std::collections::HashMap;

use screeps::{creep, find, game, pathfinder::{self, MultiRoomCostResult, PathFinder, SearchOptions}, CircleStyle, CostMatrix, CostMatrixGet, CostMatrixSet, Creep, HasId, HasPosition, LocalCostMatrix, RoomName, SharedCreepProperties, StructureObject, StructureType, StructureWall};
use screeps::{find, game, pathfinder::{self, MultiRoomCostResult, SearchOptions}, CircleStyle, CostMatrixGet, CostMatrixSet, Creep, HasId, HasPosition, LocalCostMatrix, RoomName, SharedCreepProperties, StructureObject};

use crate::{memory::ScreepsMemory, movement::move_target::MoveOptions, profiling::timing::PATHFIND_CPU, room::cache::RoomCache, traits::{creep::CreepExtensions, intents_tracking::CreepExtensionsTracking}, utils::new_xy};

Expand Down
3 changes: 1 addition & 2 deletions src/room/democracy.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::mem;

use log::info;
use screeps::{
game, look::{self, LookResult}, pathfinder::MultiRoomCostResult, CircleStyle, HasPosition, LocalCostMatrix, MapTextStyle, MapVisual, Position, Room, RoomCoordinate, RoomName, RoomPosition, StructureObject, StructureProperties, StructureRoad, StructureType, Terrain
game, look::{self, LookResult}, pathfinder::MultiRoomCostResult, CircleStyle, HasPosition, LocalCostMatrix, MapTextStyle, MapVisual, Position, Room, RoomCoordinate, RoomName, RoomPosition, StructureProperties, StructureType, Terrain
};

use crate::{
Expand Down
1 change: 0 additions & 1 deletion src/room/planning/room/roads.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::collections::HashMap;

use log::info;
use screeps::{
game,
pathfinder::{self, MultiRoomCostResult, SearchOptions},
Expand Down
5 changes: 2 additions & 3 deletions src/room/planning/room/skippy_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ use log::info;
use screeps::{find, game, CircleStyle, CostMatrixSet, HasId, HasPosition, LocalCostMatrix, Room, StructureType, Terrain, TextStyle};

use crate::{
memory::{RoomMemory, ScreepsMemory, SkippyMem},
room::visuals, utils::{self, new_xy},
memory::{RoomMemory, SkippyMem}, utils::{self, new_xy},
};

use super::structure_visuals::{self, RoomVisualExt};
use super::structure_visuals::{RoomVisualExt};

pub fn stamp_list() -> Vec<(u8, Vec<Vec<char>>)> {
vec![
Expand Down
5 changes: 2 additions & 3 deletions src/room/spawning/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{cmp, collections::HashMap, vec};

use creep_sizing::{base_hauler_body, mineral_miner_body, storage_sitter_body};
use log::info;
use screeps::{
find, game, HasHits, HasId, HasPosition, Part, Position, ResourceType, Room, RoomName,
SharedCreepProperties,
Expand Down Expand Up @@ -770,7 +769,7 @@ pub fn upgrader(
return None;
}

let mut target_work_parts = match cache.rcl {
let target_work_parts = match cache.rcl {
1 => 5,
2 => 15,
3 => 22,
Expand Down Expand Up @@ -1567,7 +1566,7 @@ pub fn season_scorer(
cache: &RoomCache,
memory: &mut ScreepsMemory,
) -> Option<SpawnRequest> {
use std::u32;


let flag = game::flags().get("depositScore".to_string());

Expand Down
1 change: 0 additions & 1 deletion src/room/tower.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use log::info;
use screeps::{HasHits, HasId, ResourceType, StructureProperties};

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use screeps::{

use crate::{
config, heap,
memory::{self, Role},
memory::{Role},
movement::move_target::MoveTarget,
room::cache::{hauling::HaulingPriority, CachedRoom, RoomCache},
traits::room::RoomType,
Expand Down

0 comments on commit 4a4da9e

Please sign in to comment.