Skip to content

Commit 159f16e

Browse files
committed
more namespace updates
1 parent 589211f commit 159f16e

File tree

7 files changed

+22
-32
lines changed

7 files changed

+22
-32
lines changed

Cargo.lock

Lines changed: 3 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ build = "sh .build.sh"
99
[dependencies.tcod]
1010
git = "https://github.com/tomassedovic/tcod-rs.git"
1111

12-
[dependencies.stainless]
13-
git = "https://github.com/reem/stainless.git"
12+
#[dependencies.stainless]
13+
#git = "https://github.com/reem/stainless.git"

src/input.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,21 @@ impl InputComponent<KeyState> for TcodInputComponent {
4040
fn translate_input(&self, key_state: KeyState) -> KeyboardInput {
4141
let key : Key = if key_state.shift {
4242
match key_state.key {
43-
self::tcod::Special(tcod::KeyCode::Number5) => Key::Printable('%'),
44-
self::tcod::Special(tcod::KeyCode::Number6) => Key::Printable('^'),
45-
self::tcod::Special(tcod::KeyCode::Number8) => Key::Printable('*'),
46-
_ => Key::SpecialKey(KeyCode::None)
43+
self::tcod::Key::Special(tcod::KeyCode::Number5) => Key::Printable('%'),
44+
self::tcod::Key::Special(tcod::KeyCode::Number6) => Key::Printable('^'),
45+
self::tcod::Key::Special(tcod::KeyCode::Number8) => Key::Printable('*'),
46+
_ => Key::SpecialKey(KeyCode::None)
4747
}
4848
} else {
4949
match key_state.key {
50-
self::tcod::Printable('/') => Key::Printable('/'),
51-
self::tcod::Special(tcod::KeyCode::Up) => Key::SpecialKey(KeyCode::Up),
52-
self::tcod::Special(tcod::KeyCode::Down) => Key::SpecialKey(KeyCode::Down),
53-
self::tcod::Special(tcod::KeyCode::Left) => Key::SpecialKey(KeyCode::Left),
54-
self::tcod::Special(tcod::KeyCode::Right) => Key::SpecialKey(KeyCode::Right),
55-
self::tcod::Special(tcod::KeyCode::Shift) => Key::SpecialKey(KeyCode::Shift),
56-
self::tcod::Special(tcod::KeyCode::Escape) => Key::SpecialKey(KeyCode::Escape),
57-
_ => Key::SpecialKey(KeyCode::None)
50+
self::tcod::Key::Printable('/') => Key::Printable('/'),
51+
self::tcod::Key::Special(tcod::KeyCode::Up) => Key::SpecialKey(KeyCode::Up),
52+
self::tcod::Key::Special(tcod::KeyCode::Down) => Key::SpecialKey(KeyCode::Down),
53+
self::tcod::Key::Special(tcod::KeyCode::Left) => Key::SpecialKey(KeyCode::Left),
54+
self::tcod::Key::Special(tcod::KeyCode::Right) => Key::SpecialKey(KeyCode::Right),
55+
self::tcod::Key::Special(tcod::KeyCode::Shift) => Key::SpecialKey(KeyCode::Shift),
56+
self::tcod::Key::Special(tcod::KeyCode::Escape) => Key::SpecialKey(KeyCode::Escape),
57+
_ => Key::SpecialKey(KeyCode::None)
5858
}
5959
};
6060

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extern crate tcod;
22
extern crate dwemthys;
33

44
use dwemthys::game::Game;
5-
use dwemthys::input::{SpecialKey, KeyCode};
5+
use dwemthys::input::{Key, KeyCode};
66
use tcod::Console;
77

88
#[cfg(not(test))]
@@ -16,8 +16,8 @@ fn main() {
1616

1717
// update game state
1818
match keypress.key {
19-
SpecialKey(KeyCode::Escape) => game.exit = true,
20-
_ => {}
19+
Key::SpecialKey(KeyCode::Escape) => game.exit = true,
20+
_ => {}
2121
}
2222
game.update();
2323

src/rendering/renderers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl RenderingComponent for TcodRenderingComponent {
5656
let messages = window.get_messages();
5757

5858
for message in messages.iter() {
59-
window.print_message(0, line, tcod::Left, message.as_slice());
59+
window.print_message(0, line, tcod::TextAlignment::Left, message.as_slice());
6060
line = line + 1;
6161
}
6262

src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub enum PointEquality {
1515
PointsNotEqual
1616
}
1717

18-
#[deriving(Clone, Show)]
18+
#[deriving(Clone, Show, PartialEq, Eq)]
1919
pub struct Point {
2020
pub x: i32,
2121
pub y: i32

tests/lib.rs

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)