I think I finished it...

This commit is contained in:
Cutieguwu
2026-02-15 17:39:48 -05:00
parent 0fad1b74bc
commit 79629391c5
33 changed files with 215 additions and 389 deletions

View File

@@ -1,14 +1,12 @@
use std::collections::HashSet;
use std::fs::{File, OpenOptions};
use std::io::Read;
use std::path::{Path, PathBuf};
use std::path::PathBuf;
use serde::{Deserialize, Serialize};
use crate::class::Class;
use crate::meta::Meta;
use crate::package::Package;
use crate::prelude::Dependency;
pub const F_PREY_TOML: &str = "Prey.toml";
pub const F_PREY_LOCK: &str = "Prey.lock";
@@ -21,6 +19,15 @@ pub struct Prey {
}
impl Prey {
pub fn new<S: ToString>(name: S) -> Self {
Self {
package: Package {
entry_point: PathBuf::from(""),
},
meta: Meta::new(name),
}
}
pub fn entry_point(&self) -> PathBuf {
self.package.entry_point.clone()
}
@@ -56,12 +63,12 @@ impl TryFrom<File> for Prey {
/// Data struct
#[derive(Debug, Clone, Default, Deserialize, Serialize, PartialEq, Eq)]
pub struct PreyLock {
pub classes: HashSet<Class>,
pub classes: Vec<Class>,
}
impl PreyLock {
pub fn with_class(&mut self, class: Class) -> &mut Self {
self.classes.insert(class);
self.classes.push(class);
self
}
}