Compare commits
8 Commits
15b585df02
...
backend-ax
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
edbeda7fae | ||
|
|
2f26815cd4 | ||
|
|
ccea905b69 | ||
|
|
3a8219f867 | ||
|
|
b2c18ac45e | ||
|
|
7a3e8fac3c | ||
|
|
137218e2c1 | ||
|
|
ad96b9c04d |
38
README.md
38
README.md
@@ -1,31 +1,19 @@
|
||||
Règles :
|
||||
|
||||
- Un rayon laser constant
|
||||
|
||||
- Un ou plusieurs laser
|
||||
|
||||
- Laser non movibles, peut-être allumé/éteins
|
||||
|
||||
- Mirroirs orientables
|
||||
|
||||
- Prisme (dédouble le laser ou le renvoi selon l'angle)
|
||||
|
||||
- Vitre colorée fixe ou placable par le joueur (r,j,b)
|
||||
|
||||
- Bouton allumable par clique souris (interaction porte, mirroir, etc)
|
||||
|
||||
- Bouton allumable par laser spécifique (interaction porte, mirroir, etc)
|
||||
Règles :
|
||||
Un rayon laser constant
|
||||
Un ou plusieurs laser
|
||||
Laser non movibles, on/off
|
||||
Mirroirs orientables
|
||||
Prisme (dédouble le laser ou le renvoi selon l'angle)
|
||||
Vitre colorée fixe ou placable par le joueur (r,j,b)
|
||||
Bouton allumable par clique souris (interaction porte, mirroir, etc)
|
||||
Bouton allumable par laser spécifique (interaction porte, mirroir, etc)
|
||||
|
||||
|
||||
Rayon :
|
||||
|
||||
- Blanc -> Rebondis seulement sur les mirroirs et s'arrête contre les murs
|
||||
|
||||
- Rouge -> Allumage des récepteurs
|
||||
|
||||
- Bleu -> Rebondis sur toutes les surfaces (murs compris)
|
||||
|
||||
- Jaune -> Traverse tout (mirroir compris)
|
||||
Blanc -> rebondis seulement sur les mirroirs et s'arrête contre les murs
|
||||
Rouge -> Allumage boutons
|
||||
Bleu -> Rebondis sur toutes les surfaces
|
||||
Jaune -> Traverse tout (mirroir compris)
|
||||
|
||||
|
||||
Systeme de placement d'objet par grille
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
use sqlite::Connection;
|
||||
use sqlite::State;
|
||||
|
||||
pub struct User {
|
||||
name: String,
|
||||
level: u32,
|
||||
password: String,
|
||||
}
|
||||
|
||||
impl User {
|
||||
pub fn open(name: String, level: u32, password: String) -> User {
|
||||
User {name, level, password}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pub struct DataBase {
|
||||
connection: Connection,
|
||||
}
|
||||
|
||||
impl DataBase {
|
||||
pub fn open(name: String) -> DataBase {
|
||||
let connection = sqlite::open(name + ".db").unwrap();
|
||||
DataBase { connection }
|
||||
}
|
||||
|
||||
fn execute(&self, arg: String){
|
||||
match self.connection.execute(arg){
|
||||
_ => (),
|
||||
Err(e) => panic!("Error : {}",e),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn create_table(&self, table: &str, var: &str){
|
||||
self.execute("CREATE TABLE ".to_owned() + &table.to_string() + "(" + &var.to_string() + ");");
|
||||
}
|
||||
|
||||
pub fn add_column(&self, table: &str, arg: &str){
|
||||
self.execute("ALTER TABLE ".to_owned() + &table.to_string() + " ADD " + &arg.to_string() + ";");
|
||||
}
|
||||
|
||||
pub fn insert(&self, table: &str, arg: &str){
|
||||
self.execute("INSERT INTO ".to_owned() + &table.to_string() + " VALUES (" + &arg.to_string() + ")" + ";");
|
||||
}
|
||||
|
||||
pub fn check(&self, table: &str, arg: &str) -> bool {
|
||||
let mut end = false;
|
||||
self.connection.iterate("Select name FROM ".to_owned() + &table.to_string() + " WHERE name = " + &arg.to_string(), |pairs| {
|
||||
for &(name, value) in pairs.iter() {
|
||||
println!("{} = {}", name, value.unwrap());
|
||||
if name == "name" {
|
||||
println!("True");
|
||||
end = true;
|
||||
}
|
||||
}
|
||||
return end;
|
||||
});
|
||||
return end;
|
||||
}
|
||||
|
||||
pub fn update(&self, table: &str, arg: &str, where_is: &str, arg2: &str){
|
||||
self.execute("UPDATE ".to_owned() + &table.to_string() + " SET " + &arg.to_string() + " WHERE " + &where_is.to_string() + " = " + &arg2.to_string());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user