Skip to content

Commit

Permalink
config messaget pois
Browse files Browse the repository at this point in the history
  • Loading branch information
PootisHunter committed Jul 10, 2024
1 parent a489e48 commit 8449730
Showing 1 changed file with 15 additions and 51 deletions.
66 changes: 15 additions & 51 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,22 @@ use uuid::{uuid, Uuid};

use crate::flag_generator::Flag;

#[derive(Deserialize,Clone)]
#[derive(Deserialize, Clone)]

pub struct CourseConfiguration {
pub course_identifier: CourseIdentifier,
pub weeks: Vec<Weeks>,
<<<<<<< HEAD
pub taskbuild: Vec<WeeksTasksBuild>,
=======
pub tasks: Vec<WeeksTasks>,
pub taskbuild: WeeksTasksBuild,
>>>>>>> e05ba41fc8ced75fcdf6946c1e93b172b71ff364
pub taskoutput: Vec<WeeksTasksOutput>,
}

impl CourseConfiguration {
<<<<<<< HEAD
pub fn new(
course_identifier: CourseIdentifier,
weeks: Vec<Weeks>,
taskbuild: Vec<WeeksTasksBuild>,
taskoutput: Vec<WeeksTasksOutput>,
) -> CourseConfiguration {
=======
pub fn new(course_identifier: CourseIdentifier, weeks: Vec<Weeks>, tasks: Vec<WeeksTasks>, taskbuild: WeeksTasksBuild, taskoutput: Vec<WeeksTasksOutput>) -> CourseConfiguration {
>>>>>>> e05ba41fc8ced75fcdf6946c1e93b172b71ff364
CourseConfiguration {
course_identifier,
weeks,
Expand All @@ -40,21 +31,22 @@ impl CourseConfiguration {
}
}

#[derive(Deserialize,Clone)]
#[derive(Deserialize, Clone)]
pub struct CourseIdentifier {
<<<<<<< HEAD
//TODO:Change to UUID
=======
//Change to UUID
>>>>>>> e05ba41fc8ced75fcdf6946c1e93b172b71ff364
pub identifier: String,
pub name: String,
pub description: String,
pub version: String,
}

impl CourseIdentifier {
pub fn new(identifier: String, name: String, description: String, version: String) -> CourseIdentifier {
pub fn new(
identifier: String,
name: String,
description: String,
version: String,
) -> CourseIdentifier {
CourseIdentifier {
identifier,
name,
Expand All @@ -63,37 +55,28 @@ impl CourseIdentifier {
}
}
}
#[derive(Deserialize,Clone)]
#[derive(Deserialize, Clone)]
pub struct Weeks {
<<<<<<< HEAD
pub tasks: Vec<WeeksTasks>,
=======
>>>>>>> e05ba41fc8ced75fcdf6946c1e93b172b71ff364
pub number: i32,
pub theme: String,
}

impl Weeks {
<<<<<<< HEAD
pub fn new(tasks: Vec<WeeksTasks>, number: i32, theme: String) -> Weeks {
Weeks {
tasks,
=======
pub fn new(number: i32, theme: String) -> Weeks {
Weeks {
>>>>>>> e05ba41fc8ced75fcdf6946c1e93b172b71ff364
number,
theme,
}
}
}
#[derive(Deserialize,Clone)]
#[derive(Deserialize, Clone)]
pub struct WeeksTasks {
pub id: String,
pub name: String,
pub description: String,
pub points: f32,
<<<<<<< HEAD
pub flags: Vec<FlagConfig>,
pub subtasks: Option<Vec<SubTask>>,
}
Expand All @@ -107,14 +90,6 @@ impl WeeksTasks {
flags: Vec<FlagConfig>,
subtasks: Option<Vec<SubTask>>,
) -> WeeksTasks {
=======
pub flags: Vec<Flag>,
pub subtasks: Vec<SubTask>,
}

impl WeeksTasks {
pub fn new(id: String, name: String, description: String, points: f32, flags: Vec<Flag>, subtasks: Vec<SubTask>) -> WeeksTasks {
>>>>>>> e05ba41fc8ced75fcdf6946c1e93b172b71ff364
WeeksTasks {
id,
name,
Expand All @@ -125,27 +100,19 @@ impl WeeksTasks {
}
}
}
<<<<<<< HEAD
#[derive(Deserialize)]
pub struct FlagConfig {
=======
#[derive(Deserialize,Clone)]
pub struct Flag {
>>>>>>> e05ba41fc8ced75fcdf6946c1e93b172b71ff364
pub flag_type: String,
pub id: String,
}

impl Flag {
pub fn new(flag_type: String, id: String) -> Flag {
Flag {
flag_type,
id,
}
Flag { flag_type, id }
}
}

#[derive(Deserialize,Clone)]
#[derive(Deserialize, Clone)]
pub struct SubTask {
pub id: String,
pub name: String,
Expand All @@ -163,7 +130,7 @@ impl SubTask {
}
}
}
#[derive(Deserialize,Clone)]
#[derive(Deserialize, Clone)]
pub struct WeeksTasksBuild {
pub directory: String,
pub entrypoint: String,
Expand All @@ -179,18 +146,15 @@ impl WeeksTasksBuild {
}
}
}
#[derive(Deserialize,Clone)]
#[derive(Deserialize, Clone)]
pub struct WeeksTasksOutput {
pub name: String,
pub output_type: String,
}

impl WeeksTasksOutput {
pub fn new(name: String, output_type: String) -> WeeksTasksOutput {
WeeksTasksOutput {
name,
output_type,
}
WeeksTasksOutput { name, output_type }
}
}

Expand Down

0 comments on commit 8449730

Please sign in to comment.