remove some debug logs (PS: the graphical bug in the precedent commit is probably my computer's fault, not the game's)
This commit is contained in:
parent
c5973b2204
commit
e80e585cf5
@ -4,7 +4,6 @@ use std::sync::Arc;
|
|||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy::tasks::{AsyncComputeTaskPool, Task};
|
use bevy::tasks::{AsyncComputeTaskPool, Task};
|
||||||
use log::info;
|
|
||||||
use rand::rngs::SmallRng;
|
use rand::rngs::SmallRng;
|
||||||
use rand::seq::IteratorRandom;
|
use rand::seq::IteratorRandom;
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
@ -84,7 +83,6 @@ pub async fn grow_thread(
|
|||||||
loop {
|
loop {
|
||||||
// Receive control from the game
|
// Receive control from the game
|
||||||
while let Ok(c) = rx_control.try_recv() {
|
while let Ok(c) = rx_control.try_recv() {
|
||||||
println!("input {:?}", c);
|
|
||||||
let id = c.voronoi_id;
|
let id = c.voronoi_id;
|
||||||
cells[id] = (c, 0.);
|
cells[id] = (c, 0.);
|
||||||
}
|
}
|
||||||
@ -100,14 +98,12 @@ pub async fn grow_thread(
|
|||||||
for (c, modified) in cells.iter_mut() {
|
for (c, modified) in cells.iter_mut() {
|
||||||
if grass_grow > 0 {
|
if grass_grow > 0 {
|
||||||
if let CellKind::Grass { ref mut wealth } = c.kind {
|
if let CellKind::Grass { ref mut wealth } = c.kind {
|
||||||
// info!("grass grow {}", c.voronoi_id);
|
|
||||||
*wealth = wealth.saturating_add(grass_grow as WealthType);
|
*wealth = wealth.saturating_add(grass_grow as WealthType);
|
||||||
*modified += grass_grow as f32 / WealthType::MAX as f32;
|
*modified += grass_grow as f32 / WealthType::MAX as f32;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if forest_grow > 0 {
|
if forest_grow > 0 {
|
||||||
if let CellKind::Forest { ref mut wealth } = c.kind {
|
if let CellKind::Forest { ref mut wealth } = c.kind {
|
||||||
// info!("forest grow {}", c.voronoi_id);
|
|
||||||
*wealth = wealth.saturating_add(forest_grow as WealthType);
|
*wealth = wealth.saturating_add(forest_grow as WealthType);
|
||||||
*modified += grass_grow as f32 / WealthType::MAX as f32;
|
*modified += grass_grow as f32 / WealthType::MAX as f32;
|
||||||
}
|
}
|
||||||
@ -115,7 +111,6 @@ pub async fn grow_thread(
|
|||||||
}
|
}
|
||||||
// Don't make multiple updates at once to avoid problems and lags
|
// Don't make multiple updates at once to avoid problems and lags
|
||||||
} else if gt - last_grass_extend > GRASS_EXTEND_STEP {
|
} else if gt - last_grass_extend > GRASS_EXTEND_STEP {
|
||||||
// info!("grass extend");
|
|
||||||
for i in 0..cells.len() {
|
for i in 0..cells.len() {
|
||||||
if cells[i].1 < 1. {
|
if cells[i].1 < 1. {
|
||||||
if let Some(wealth) = cells[i].0.kind.grass_wealth() {
|
if let Some(wealth) = cells[i].0.kind.grass_wealth() {
|
||||||
@ -166,7 +161,6 @@ pub async fn grow_thread(
|
|||||||
.iter()
|
.iter()
|
||||||
.filter(|(c, _)| matches!(c.kind, CellKind::Grass { .. }))
|
.filter(|(c, _)| matches!(c.kind, CellKind::Grass { .. }))
|
||||||
.count();
|
.count();
|
||||||
// dbg!(grass_count);
|
|
||||||
|
|
||||||
last_grass_grow += grass_grow * CellKind::GRASS.growth_duration() / WealthType::MAX as u64;
|
last_grass_grow += grass_grow * CellKind::GRASS.growth_duration() / WealthType::MAX as u64;
|
||||||
last_forest_grow += forest_grow * CellKind::FOREST.growth_duration();
|
last_forest_grow += forest_grow * CellKind::FOREST.growth_duration();
|
||||||
|
Loading…
Reference in New Issue
Block a user