Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
HadziqM committed Dec 10, 2023
1 parent 2d764ca commit 68c9bac
Show file tree
Hide file tree
Showing 8 changed files with 422 additions and 632 deletions.
621 changes: 349 additions & 272 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[workspace]
members = ["discord","hertz","material","image-edit","binding"]
members = ["discord","material","image-edit","binding"]
resolver = "2"
20 changes: 8 additions & 12 deletions binding/src/bounty/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
use serde::{Serialize,Deserialize};
use crate::bitwise::ItemCode;
use crate::{bitwise::ItemCode, postgres::card::Event};

use title::Progresion;

#[derive(PartialEq, Eq,Clone,Hash)]
pub mod title;


#[derive(PartialEq, Eq,Clone,Hash,Serialize,Deserialize)]
#[serde(rename_all="snake_case")]
pub enum Category{
Bronze,
Silver,
Expand All @@ -19,15 +24,6 @@ pub enum Methode{
Multi
}

#[derive(Clone)]
pub struct Title{
pub bounty_bronze:bool,
pub bounty_silver:bool,
pub bounty_gold:bool,
pub trade_bronze:bool,
pub trade_silver:bool,
pub trade_gold:bool,
}

#[derive(PartialEq, Eq,Clone,Hash,Serialize,Deserialize)]
pub enum BBQ{
Expand Down Expand Up @@ -68,7 +64,7 @@ pub struct BountyReward{
#[derive(Clone)]
pub struct Hunter{
pub member:String,
pub title:Title,
pub title:Progresion,
pub event:Event,
}
#[derive(Clone)]
Expand Down
50 changes: 50 additions & 0 deletions binding/src/bounty/title.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
use serde::{Serialize, Deserialize};
use crate::bitwise::ItemCode;

use super::{Category,BBQ};



#[derive(Serialize,Deserialize,Clone)]
#[serde(rename_all="snake_case")]
pub enum Trigger{
BountyStage {category:Category,bbq:BBQ},
BountyCoin {coin:i32},
Manual
}

#[derive(Serialize,Deserialize,Clone)]
#[serde(rename_all="snake_case")]
pub enum Progresion {
GoldBounty,
SilverBounty,
BronzeBounty,
GoldTrading,
SilverTrading,
BronzeTrading,
}

#[derive(Serialize,Deserialize,Clone)]
pub struct TitleImage{
pub url:String,
pub diameter:u32,
pub x_start:u32,
pub y_start:u32,
}


#[derive(Serialize,Deserialize,Clone)]
#[serde(rename_all="snake_case")]
pub enum TitleType{
Progresion {name:Progresion},
Free {name:String},
Reward {name:String , reward:Vec<ItemCode>}
}

#[derive(Serialize,Deserialize,Clone)]
pub struct Title {
#[serde(rename="type")]
title_type:TitleType,
image:TitleImage,
trigger:Trigger,
}
11 changes: 11 additions & 0 deletions binding/src/utils.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use std::time::SystemTime;

pub struct MyTime;
impl MyTime {
pub fn now()-> i64{
i64::try_from(SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs()).unwrap()
}
pub fn elapsed(el:i64)-> i64{
MyTime::now() + el
}
}
5 changes: 3 additions & 2 deletions discord/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ serenity = { version = "0.12.0", default-features = false, features = ["client",
hertz = { path = "../hertz" }
tokio = { version = "1.0", features = ["full"] }
reqwest = { version = "0.11", features = ["json"] }
sqlx = { version = "0.6", features = [ "runtime-tokio-native-tls" , "postgres","chrono","macros"] }
sqlx = { version = "0.7.3", features = [ "runtime-tokio-native-tls" , "postgres","chrono","macros"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
chrono = "0.4.23"
bcrypt = "0.13"
bcrypt = "0.15"
rand = "0.8.5"
image = "0.24.5"
imageproc = "0.23.0"
rusttype = "0.9.3"
lazy_static = "1.4.0"
poise = { version = "0.5.7", features = ["time", "collector"] }
14 changes: 0 additions & 14 deletions hertz/Cargo.toml

This file was deleted.

Loading

0 comments on commit 68c9bac

Please sign in to comment.