Compare commits

..

No commits in common. "c4297847755ec0d224ca367653c179825d01f5cd" and "c6492c28c2b12a4b2fc6c048df1a492fac34438f" have entirely different histories.

3 changed files with 11 additions and 28 deletions

View File

@ -1,16 +0,0 @@
name: publish package
on:
push:
branches-ignore:
- main
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: run tests
run: |
cd ${{ gitea.workspace }}
cargo test

View File

@ -39,7 +39,7 @@ impl Chest {
impl Artifact for Chest { impl Artifact for Chest {
fn get_representation(&self) -> (&str, Color) { fn get_representation(&self) -> (&str, Color) {
("C", Color::Cyan) ("C", Color::Blue)
} }
fn get_immutable_position(&self) -> &Position { fn get_immutable_position(&self) -> &Position {

View File

@ -7,8 +7,7 @@ use crate::game::Game;
use crate::level::StructureElement; use crate::level::StructureElement;
use crate::position::HasPosition; use crate::position::HasPosition;
const FG_BROWN: Color = Color::Rgb(140, 34, 0); const FG_BROWN: Color = Color::Rgb(186, 74, 0);
const BACKGROUND: Color = Color::Black;
pub struct LevelWidget {} pub struct LevelWidget {}
@ -43,36 +42,36 @@ impl StatefulWidget for LevelWidget {
(Some(structure_element), None, None) => { (Some(structure_element), None, None) => {
match structure_element { match structure_element {
StructureElement::Start => { StructureElement::Start => {
self.set_cell(buf, x, y, "α", Color::White, BACKGROUND); self.set_cell(buf, x, y, "α", Color::Black, Color::Gray);
} }
StructureElement::End => { StructureElement::End => {
self.set_cell(buf, x, y, "Ω", Color::White, BACKGROUND); self.set_cell(buf, x, y, "Ω", Color::Black, Color::Gray);
} }
StructureElement::Wall => { StructureElement::Wall => {
// TODO add fancy walls with https://en.wikipedia.org/wiki/Box-drawing_characters // TODO add fancy walls with https://en.wikipedia.org/wiki/Box-drawing_characters
self.set_cell(buf, x, y, "#", FG_BROWN, FG_BROWN); self.set_cell(buf, x, y, "#", FG_BROWN, FG_BROWN);
} }
StructureElement::Floor => { StructureElement::Floor => {
self.set_cell(buf, x, y, " ", FG_BROWN, BACKGROUND); self.set_cell(buf, x, y, " ", FG_BROWN, Color::Gray);
} }
StructureElement::StairDown => { StructureElement::StairDown => {
self.set_cell(buf, x, y, ">", Color::White, BACKGROUND); self.set_cell(buf, x, y, ">", Color::Black, Color::Gray);
} }
StructureElement::StairUp => { StructureElement::StairUp => {
self.set_cell(buf, x, y, "<", Color::White, BACKGROUND); self.set_cell(buf, x, y, "<", Color::Black, Color::Gray);
} }
StructureElement::Unknown => { StructureElement::Unknown => {
self.set_cell(buf, x, y, "", Color::Gray, BACKGROUND); self.set_cell(buf, x, y, "", Color::DarkGray, Color::Gray);
} }
} }
} }
(_, Some(m), _) => { (_, Some(m), _) => {
let (s, c) = m.get_representation(); let (s, c) = m.get_representation();
self.set_cell(buf, x, y, s, c, BACKGROUND); self.set_cell(buf, x, y, s, c, Color::Gray);
} }
(_, _, Some(t)) => { (_, _, Some(t)) => {
let (s, c) = t.get_representation(); let (s, c) = t.get_representation();
self.set_bold_cell(buf, x, y, s, c, BACKGROUND); self.set_bold_cell(buf, x, y, s, c, Color::Gray);
} }
(None, None, None) => {} (None, None, None) => {}
}; };
@ -84,7 +83,7 @@ impl StatefulWidget for LevelWidget {
let player_pos = player.get_immutable_position(); let player_pos = player.get_immutable_position();
let player_x = al + player_pos.get_x() as u16; let player_x = al + player_pos.get_x() as u16;
let player_y = at + player_pos.get_y() as u16; let player_y = at + player_pos.get_y() as u16;
self.set_cell(buf, player_x, player_y, "8", Color::LightRed, BACKGROUND); self.set_cell(buf, player_x, player_y, "8", Color::Red, Color::Gray);
} }
} }
} }