mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 11:44:06 +00:00
Major Subsystem Rewrite (Reconciler Mk5) (#217)
This commit is contained in:
parent
8e8291a0bd
commit
fea303ac8b
80 changed files with 3843 additions and 5609 deletions
33
server/src/serve_session.rs
Normal file
33
server/src/serve_session.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
use std::collections::HashSet;
|
||||
|
||||
use crate::{
|
||||
project::Project,
|
||||
session_id::SessionId,
|
||||
};
|
||||
|
||||
/// Contains all of the state for a Rojo serve session.
|
||||
pub struct ServeSession {
|
||||
root_project: Option<Project>,
|
||||
session_id: SessionId,
|
||||
}
|
||||
|
||||
impl ServeSession {
|
||||
pub fn new(root_project: Option<Project>) -> ServeSession {
|
||||
let session_id = SessionId::new();
|
||||
|
||||
ServeSession {
|
||||
session_id,
|
||||
root_project,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_id(&self) -> SessionId {
|
||||
self.session_id
|
||||
}
|
||||
|
||||
pub fn serve_place_ids(&self) -> Option<&HashSet<u64>> {
|
||||
self.root_project
|
||||
.as_ref()
|
||||
.and_then(|project| project.serve_place_ids.as_ref())
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue