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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
//! Allows an Amethyst game to communicate with a visualizer/debugger.
//!
//! This crate provides the hooks necessary for an Amethyst game to communicate
//! with a visualizer/debugger running in another process. Once setup, it will
//! send the game's state to the debugger, and can apply commands sent back.
//!
//! # Usage
//!
//! In order to communicate with the editor, you must create a [`SyncEditorBundle`]
//! and register all of the components and resources that you want to display
//! or interact with in the debugger. Any component or resource that implements
//! `Serialize` can be displayed, and any that implements `Deserialize`
//! can also be modified at runtime within the debugger.
//!
//! Create an empty bundle with [`SyncEditorBundle::new`], and then use the
//! various helper macros to register your custom types:
//!
//! * [`sync_components`]
//! * [`read_components`]
//! * [`sync_resources`]
//! * [`read_resources`]
//!
//! You can also use the [`SyncEditorBundle::sync_default_types`] method to
//! register all of the types provided by Amethyst that can be supported by
//! the debugger.
//!
//! If you'd like a builder-like way of chaining method calls together in order
//! to build your entire bundle in a single statement, we recommend using the
//! [tap] crate to do so. The examples below demonstrate using tap in
//! conjuction with the helper macros to succinctly register a variety of
//! custom types.
//!
//! # Examples
//!
//! ```
//! extern crate amethyst;
//! extern crate amethyst_editor_sync;
//! extern crate serde;
//! extern crate tap;
//!
//! use amethyst::ecs::*;
//! use amethyst::prelude::*;
//! use amethyst_editor_sync::*;
//! use serde::*;
//! use tap::*;
//!
//! # fn main() -> Result<(), amethyst::Error> {
//! // Create a SyncEditorBundle which will create all necessary systems to send the components
//! // to the editor.
//! let editor_sync_bundle = SyncEditorBundle::new()
//!
//! // Register the default types from the engine.
//! .tap(SyncEditorBundle::sync_default_types)
//!
//! // Register any custom components and resources for your game. By default, components
//! // and resources support reading and writing, allowing you to modify values at runtime
//! // from the editor. If your component should be read-only, use the `read_*` variant
//! // when registering the type.
//! .tap(|bundle| sync_components!(bundle, MyComponent))
//! .tap(|bundle| sync_resources!(bundle, MyResource))
//! .tap(|bundle| read_resources!(bundle, ReadOnlyResource));
//!
//! let game_data = GameDataBuilder::default()
//! .with_bundle(editor_sync_bundle)?;
//! # Ok(())
//! # }
//!
//! // Make sure you enable serialization for your custom components and resources!
//! #[derive(Serialize, Deserialize)]
//! struct MyComponent {
//! foo: usize,
//! bar: String,
//! }
//!
//! impl Component for MyComponent {
//! type Storage = DenseVecStorage<Self>;
//! }
//!
//! #[derive(Serialize, Deserialize)]
//! struct MyResource {
//! baz: usize,
//! }
//!
//! // This resource can't be deserialized because it contains an Entity.
//! // As such, we register it as read-only when setting up editor support.
//! #[derive(Serialize)]
//! struct ReadOnlyResource {
//! important_entity: SerializableEntity,
//! }
//! ```
//!
//! [`SyncEditorBundle`]: ./struct.SyncEditorBundle.html
//! [`SyncEditorBundle::new`]: ./struct.SyncEditorBundle.html#method.new
//! [`sync_components`]: ./macro.sync_components.html
//! [`read_components`]: ./macro.read_components.html
//! [`sync_resources`]: ./macro.sync_resources.html
//! [`read_resources`]: ./macro.read_resources.html
//! [`SyncEditorBundle::sync_default_types`]: ./struct.SyncEditorBundle.html#method.sync_default_types
//! [tap]: https://crates.io/crates/tap
extern crate amethyst;
extern crate crossbeam_channel;
extern crate log;
extern crate log_once;
extern crate serde;
extern crate serde_json;
pub use crateSyncEditorBundle;
pub use crateEditorLogger;
pub use crateSerializableEntity;