forked from rojo-rbx/rojo
Clean up warnings, add RojoTree into ServeSession
This commit is contained in:
@@ -1,23 +1,29 @@
|
||||
use std::collections::HashSet;
|
||||
|
||||
use crate::{project::Project, session_id::SessionId};
|
||||
use crate::{project::Project, session_id::SessionId, snapshot::RojoTree};
|
||||
|
||||
/// Contains all of the state for a Rojo serve session.
|
||||
pub struct ServeSession {
|
||||
root_project: Option<Project>,
|
||||
session_id: SessionId,
|
||||
tree: RojoTree,
|
||||
}
|
||||
|
||||
impl ServeSession {
|
||||
pub fn new(root_project: Option<Project>) -> ServeSession {
|
||||
pub fn new(tree: RojoTree, root_project: Option<Project>) -> ServeSession {
|
||||
let session_id = SessionId::new();
|
||||
|
||||
ServeSession {
|
||||
session_id,
|
||||
root_project,
|
||||
tree,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn tree(&self) -> &RojoTree {
|
||||
&self.tree
|
||||
}
|
||||
|
||||
pub fn session_id(&self) -> SessionId {
|
||||
self.session_id
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user