Skip to content

Commit

Permalink
Build fixes (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
shanemadden authored Mar 18, 2024
1 parent 25dabc0 commit 07a109e
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ jobs:
matrix:
rust:
- stable
- nightly
# temporarily disabled due to https://github.com/rust-lang/rust-clippy/issues/12377
#- nightly
steps:
- name: Checkout sources
uses: actions/checkout@v2
Expand Down
5 changes: 3 additions & 2 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ mod types;
//pub mod look; // TODO: most/all of this is World specific
//pub mod find; // TODO: most/all of this is World specific

pub use self::{small_enums::*, types::*, numbers::*};
//pub use self::{extra::*, look::*, recipes::FactoryRecipe}; // TODO: most/all of this is World specific
pub use self::{numbers::*, small_enums::*, types::*};
//pub use self::{extra::*, look::*, recipes::FactoryRecipe}; // TODO: most/all
// of this is World specific

// pub use self::find::{FindConstant, Find, CREEPS, MY_CREEPS, HOSTILE_CREEPS,
// SOURCES_ACTIVE, SOURCES, DROPPED_RESOURCES, STRUCTURES, MY_STRUCTURES,
Expand Down
24 changes: 15 additions & 9 deletions src/constants/numbers.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@

pub const BODYPART_HITS: u32 = 100;

pub const RANGED_ATTACK_POWER: u32 = 10;
pub const RANGED_ATTACK_POWER: u32 = 10;

pub const RANGED_ATTACK_DISTANCE_RATE: &[f32;4] = &[1.0_f32, 1.0_f32, 0.4_f32, 0.1_f32];
pub const RANGED_ATTACK_DISTANCE_RATE: &[f32; 4] = &[1.0_f32, 1.0_f32, 0.4_f32, 0.1_f32];

pub const ATTACK_POWER: u32 = 30;
pub const ATTACK_POWER: u32 = 30;

pub const HEAL_POWER: u32 = 12;
pub const HEAL_POWER: u32 = 12;

pub const RANGED_HEAL_POWER: u32 = 4;
pub const RANGED_HEAL_POWER: u32 = 4;

pub const CARRY_CAPACITY: u32 = 50;

Expand All @@ -25,7 +24,14 @@ pub const HARVEST_POWER: u32 = 2;

pub const BUILD_POWER: u32 = 5;

pub const OBSTACLE_OBJECT_TYPES: &[&str;6] = &["creep","tower","constructedWall","spawn","extension","link"];
pub const OBSTACLE_OBJECT_TYPES: &[&str; 6] = &[
"creep",
"tower",
"constructedWall",
"spawn",
"extension",
"link",
];

pub const TOWER_ENERGY_COST: u32 = 10;

Expand Down Expand Up @@ -53,9 +59,9 @@ pub const MAX_CREEP_SIZE: u32 = 50;

pub const CREEP_SPAWN_TIME: u32 = 3;

pub const RESOURCE_ENERGY: &str = "energy";
pub const RESOURCE_ENERGY: &str = "energy";

pub const RESOURCES_ALL: &[&str;1] = &[RESOURCE_ENERGY];
pub const RESOURCES_ALL: &[&str; 1] = &[RESOURCE_ENERGY];

pub const SOURCE_ENERGY_REGEN: u32 = 10;

Expand Down
6 changes: 1 addition & 5 deletions src/constants/small_enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ use num_derive::FromPrimitive;
use num_traits::FromPrimitive;
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};
use std::{
convert::{Infallible, TryFrom},
fmt,
str::FromStr,
};
use std::{convert::Infallible, fmt, str::FromStr};
use wasm_bindgen::prelude::*;
//use crate::constants::find::Find;

Expand Down
13 changes: 12 additions & 1 deletion src/objects/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ mod structure_tower;
mod structure_wall;

pub use self::{
arena::*,
construction_site::{ConstructionSite, CONSTRUCTION_SITE_PROTOTYPE},
creep::{Creep, CREEP_PROTOTYPE},
game_object::{GameObject, GAME_OBJECT_PROTOTYPE},
Expand All @@ -33,3 +32,15 @@ pub use self::{
structure_tower::{StructureTower, STRUCTURE_TOWER_PROTOTYPE},
structure_wall::{StructureWall, STRUCTURE_WALL_PROTOTYPE},
};

#[cfg(feature = "enable-body-part")]
pub use self::arena::{BodyPart, BODY_PART_PROTOTYPE};

#[cfg(feature = "enable-flag")]
pub use self::arena::{Flag, FLAG_PROTOTYPE};

#[cfg(feature = "enable-area-effect")]
pub use self::arena::{AreaEffect, AREA_EFFECT_PROTOTYPE};

#[cfg(feature = "enable-score")]
pub use self::arena::{ScoreCollector, SCORE_COLLECTOR_PROTOTYPE};

0 comments on commit 07a109e

Please sign in to comment.