Deck to waste and waste to deck working-ish
This commit is contained in:
@@ -25,18 +25,16 @@ const CARD_HEIGHT: u16 = 11;
|
||||
const CARD_WIDTH: u16 = 15;
|
||||
|
||||
fn draw_waste(cards_in_waste: &Vec<card_stuffs::Card>, area: Rect, frame: &mut Frame) {
|
||||
|
||||
let horizontal = Layout::horizontal([
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(CARD_WIDTH),
|
||||
]);
|
||||
let [w1, w2, top_waste] = horizontal.areas(area);
|
||||
// There must be a better way to do this
|
||||
|
||||
// There must be a better way to do this
|
||||
if cards_in_waste.len() == 0 {
|
||||
frame.render_widget(
|
||||
// TODO too tall for some reason
|
||||
empty_pile(),
|
||||
top_waste
|
||||
);
|
||||
@@ -332,7 +330,8 @@ impl App {
|
||||
fn handle_key_event(&mut self, key_event: KeyEvent) {
|
||||
match key_event.code {
|
||||
KeyCode::Char('q') => self.exit(),
|
||||
KeyCode::Char('d') => self.cards.draw(),
|
||||
KeyCode::Char('d') => self.cards.deck_to_waste(),
|
||||
KeyCode::Char('w') => self.cards.waste_to_deck(),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user