aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 65ada01619699fe18616d5b962ce5d469161afec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
extern crate rand;
extern crate pancurses;

#[macro_use]
extern crate text_io;

mod character;
mod computer;
mod world;

use character::Player;
use computer::Enemy;
use pancurses::{initscr, endwin};
use rand::Rng;
use std::io;

fn main() {
    let window = initscr();
    window.printw("Hello Rust");
    window.refresh();
    window.mv(2, 2);
    window.printw("toto");
    window.refresh();
    window.getch();
    endwin();
}
    // println!(
    //     "=== Welcome to RRL {} the {}! ===\n",
    //     env!("CARGO_PKG_DESCRIPTION"), env!("CARGO_PKG_VERSION")
    // );

    // let characters: [character::Character; 5] = [
    //     character::Character::new("".to_string(), "Cleric".to_string(), 7, 5, 6, 7),
    //     character::Character::new("".to_string(), "Warrior".to_string(), 10, 5, 5, 5),
    //     character::Character::new("".to_string(), "Hunter".to_string(), 5, 7, 7, 6),
    //     character::Character::new("".to_string(), "Wizard".to_string(), 3, 10, 5, 7),
    //     character::Character::new("".to_string(), "Thief".to_string(), 4, 5, 6, 10),
    // ];

    // let _luck_amount = rand::thread_rng().gen_range(2, 6);

    // println!("You enter the Ephemeral Plane of Creation...");
    // println!("Please enter your name.");

    // let mut input_text = String::new();

    // io::stdin()
    //     .read_line(&mut input_text)
    //     .expect("Failed to read line");
    // let _character_name = input_text.trim();

    // println!("Please select your character type:");
    // for (i, elem) in characters.iter().enumerate() {
    //     print!("\n{}. {}\n\n", i + 1, elem.info());
    // }

    // let mut character_index: usize = 100;
    // while character_index > characters.len() {
    //     character_index = read!();
    // }

    // let mut player = characters[character_index].select(_character_name.to_string(), _luck_amount);

    // play(&mut player);
// }

fn play(player: &mut character::Character) {
    println!("=== Welcome to RRL {} the {}! ===\n", player.name, player.class);
    println!("Your unique stats: {}", player.stats());
}