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
//! This module contains the commands that manipulate the visual representation of the map.
//! The commands are used to load, update and delete the tiles, and are also set in a way that
//! they can be undone and redone.
//!
//! Commands are an efficient way to perform a large number of operations on the ECS in a single
//! frame. They are used to perform operations on the ECS in a way that is more efficient than
//! using the ECS API directly.
//!
//! However, commands are not a good fit for all, they have full access to the World and can
//! be quite convoluted to use if we abuse them.
//!
//! To avoid having god-like commands responsible for everything, we use the command pattern to
//! trigger the drawing flow, and then we use the ECS API to perform the operations.
use crateDrawingBundle;
use crateFrameGroupComponent;
use crate;
use crateTilePosition;
use crateLayer;
use *;
pub use *;
/// A struct that holds the state of a command, used to keep track of the commands that were
/// applied and persisted. This is used by the ECS systems to manipulate the entities that
/// were triggered by a command in a more distributed and efficient way.
///
/// Applied means that the command was already applied to the ECS, meaning that the entities
/// were created, updated or deleted and the necessary states and resources were updated.
///
/// Persisted means that that the effects of the command were translated to the persistence
/// layer, meaning that the changes were saved to the storage, like a database or similar.
/// An alternative version of DrawingBundle that holds the drawing information in a more
/// flexible way, so that it can be used in the commands and systems that manipulate the
/// drawing entities. Differently from DrawingBundle, this type is not a bundle, so it doesn't
/// get added to the ECS directly.
///
/// It has an optional AppearanceDescriptor, so that it can be used to represent the old state
/// of the entity, when reverting a command. An empty appearance means that the entity is freshly
/// created or should be deleted, depending on the context used.
pub type DrawingInfo = ;