Renderer, Oberfläche, Eingabe, Sound-Modul, Simulationstest und Docker-Setup (Port 18093)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
14e481cffb
commit
db417b3af8
13 files changed
+1930
-19
No files matched your search
+2
-9
@@ -59,9 +59,6 @@ impl Tile {
|
||||
Kind::Floor | Kind::Treasury | Kind::Lair | Kind::Farm | Kind::Training | Kind::Library | Kind::Portal | Kind::Gate
|
||||
)
|
||||
}
|
||||
pub fn is_room(&self) -> bool {
|
||||
matches!(self.kind, Kind::Treasury | Kind::Lair | Kind::Farm | Kind::Training | Kind::Library)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn idx(x: i32, y: i32) -> usize {
|
||||
@@ -148,7 +145,7 @@ impl Map {
|
||||
let portal = (rng.range(24, 30), if core.1 > 31 { rng.range(12, 18) } else { rng.range(44, 50) });
|
||||
let gate = (rng.range(51, 55), rng.range(10, 50));
|
||||
|
||||
let mut blob = |t: &mut Vec<Tile>, rng: &mut Rng, cx: i32, cy: i32, r: i32, k: Kind| {
|
||||
let blob = |t: &mut Vec<Tile>, rng: &mut Rng, cx: i32, cy: i32, r: i32, k: Kind| {
|
||||
for y in cy - r..=cy + r {
|
||||
for x in cx - r..=cx + r {
|
||||
if !inb(x, y) || x < 2 || y < 2 || x >= MW as i32 - 2 || y >= MH as i32 - 2 {
|
||||
@@ -187,7 +184,7 @@ impl Map {
|
||||
blob(&mut t, &mut rng, cx, cy, 1, Kind::Gold);
|
||||
}
|
||||
|
||||
let mut room = |t: &mut Vec<Tile>, x0: i32, y0: i32, x1: i32, y1: i32, owner: Owner| {
|
||||
let room = |t: &mut Vec<Tile>, x0: i32, y0: i32, x1: i32, y1: i32, owner: Owner| {
|
||||
for y in y0..=y1 {
|
||||
for x in x0..=x1 {
|
||||
if inb(x, y) && x >= 2 && y >= 2 && x < MW as i32 - 2 && y < MH as i32 - 2 {
|
||||
@@ -327,8 +324,4 @@ impl Map {
|
||||
pub fn path_to(&self, start: usize, target: usize) -> Option<Vec<usize>> {
|
||||
self.search(start, self.walk_cost(), |i| i == target, true)
|
||||
}
|
||||
|
||||
pub fn count(&self, k: Kind) -> usize {
|
||||
self.t.iter().filter(|t| t.kind == k && t.owner == Owner::Player).count()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user