From f68e7b59a08b3c211b6eeff70f7346d4d1e71a66 Mon Sep 17 00:00:00 2001 From: tslil clingman <> Date: Sat, 15 Feb 2020 16:31:05 -0800 Subject: Preparing for release --- src/consulter.rs | 17 ++++++++++++++++ src/game.rs | 17 ++++++++++++++++ src/gui.rs | 59 +++++++++++++++++--------------------------------------- src/main.rs | 30 +++++++++++++++++++++++----- src/parser.rs | 17 ++++++++++++++++ 5 files changed, 94 insertions(+), 46 deletions(-) (limited to 'src') diff --git a/src/consulter.rs b/src/consulter.rs index 250fd1c..78fa07d 100644 --- a/src/consulter.rs +++ b/src/consulter.rs @@ -1,3 +1,20 @@ +/* + This file is part of Takwrap. + + Takwrap is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Foobar is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Foobar. If not, see . +*/ + use std::fs::{remove_file, File}; use std::io::{Error, ErrorKind, Result, Write}; use std::process::Command; diff --git a/src/game.rs b/src/game.rs index 18e6fe5..4a91755 100644 --- a/src/game.rs +++ b/src/game.rs @@ -1,3 +1,20 @@ +/* + This file is part of Takwrap. + + Takwrap is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Foobar is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Foobar. If not, see . +*/ + use std::collections::HashSet; use std::fmt; diff --git a/src/gui.rs b/src/gui.rs index 3a828b6..98c29c0 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -1,3 +1,20 @@ +/* + This file is part of Takwrap. + + Takwrap is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Foobar is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Foobar. If not, see . +*/ + extern crate pancurses; pub use pancurses::Input::*; @@ -294,46 +311,6 @@ impl BoardGUI { self.board_window.untouch(); } - /* - pub fn read_action(&mut self) -> GUIResult { - loop { - if let Some(key) = self.board_window.getch() { - match key { - KeyDown => { - if 0 < self.cur_cell.y { - self.cur_cell.y -= 1; - self.mv_to_cell(&self.cur_cell, 0); - } - } - KeyUp => { - if self.cur_cell.y + 1 < self.size { - self.cur_cell.y += 1; - self.mv_to_cell(&self.cur_cell, 0); - } - } - KeyLeft => { - if 0 < self.cur_cell.x { - self.cur_cell.x -= 1; - self.mv_to_cell(&self.cur_cell, 0); - } - } - KeyRight => { - if self.cur_cell.x + 1 < self.size { - self.cur_cell.x += 1; - self.mv_to_cell(&self.cur_cell, 0); - } - } - Character('q') => (), - - x => { - self.board_window.addstr(format!("{:?}", x)); - self.board_window.refresh(); - } - } - } - } - }*/ - pub fn new( ypos: i32, xpos: i32, @@ -770,7 +747,7 @@ impl GUI { return false; } else { self.message_log.log_error(format!( - "Cannot perform \"{}\": p{}", + "Cannot perform \"{}\": {}", act_string, e )); } diff --git a/src/main.rs b/src/main.rs index 31414b8..8ce24d2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,22 @@ +/* +Takwrap, a TUI for playing Tak and interacting with Tak engines. + +Copyright (C) 2020, tslil clingman + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + */ + extern crate argparse; extern crate chrono; @@ -27,13 +46,14 @@ fn main() { let mut size: u8 = 5; let mut start_type_string = String::new(); + println!("Takwrap, a TUI for playing Tak and interacting with Tak engines.\n +Copyright (C) 2020, tslil clingman\n +This program comes with ABSOLUTELY NO WARRANTY; and is made available under the terms of the GNU GPL v3 license. This is free software, and you are welcome to redistribute it under certain conditions; see COPYING for details.\n" + ); + { let mut ap = ArgumentParser::new(); - ap.set_description( - "A TUI - implementation of and wrapper for engines for the game of - Tak.", - ); + ap.set_description(""); ap.refer(&mut p1_name).add_option( &["--player1"], diff --git a/src/parser.rs b/src/parser.rs index ba58b72..a134bb9 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1,3 +1,20 @@ +/* + This file is part of Takwrap. + + Takwrap is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Foobar is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Foobar. If not, see . +*/ + use crate::game::*; fn parse_move(mv: &str) -> Result { -- cgit v1.3.1