1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
use crate::{Resource, SerializedData, YyResource, YyResourceHandler, YypBoss};
use yy_typings::{TileSet, ViewPath};
impl YyResource for TileSet {
type AssociatedData = ();
const SUBPATH_NAME: &'static str = "tilesets";
const RESOURCE: Resource = Resource::TileSet;
fn name(&self) -> &str {
&self.resource_data.name
}
fn set_name(&mut self, name: String) {
self.resource_data.name = name;
}
fn set_parent_view_path(&mut self, vp: ViewPath) {
self.resource_data.parent = vp;
}
fn parent_view_path(&self) -> ViewPath {
self.resource_data.parent.clone()
}
fn get_handler(yyp_boss: &YypBoss) -> &YyResourceHandler<Self> {
&yyp_boss.tilesets
}
fn get_handler_mut(yyp_boss: &mut YypBoss) -> &mut YyResourceHandler<Self> {
&mut yyp_boss.tilesets
}
fn serialize_associated_data(
&self,
_directory_path: &std::path::Path,
_data: &Self::AssociatedData,
) -> anyhow::Result<()> {
Ok(())
}
fn deserialize_associated_data(
&self,
_directory_path: &std::path::Path,
_tcu: &yy_typings::utils::TrailingCommaUtility,
) -> Result<Self::AssociatedData, crate::SerializedDataError> {
Ok(())
}
fn serialize_associated_data_into_data(
_working_directory: &std::path::Path,
_associated_data: &Self::AssociatedData,
) -> Result<crate::SerializedData, crate::SerializedDataError> {
Ok(SerializedData::Value {
data: String::new(),
})
}
fn deserialize_associated_data_from_data(
&self,
_incoming_data: &crate::SerializedData,
_tcu: &yy_typings::utils::TrailingCommaUtility,
) -> Result<Self::AssociatedData, crate::SerializedDataError> {
Ok(())
}
fn cleanup_on_replace(&self, _: impl crate::FileHolder) {}
}