Esempio n. 1
0
 /// <summary>
 /// Adds a layer to the game state.
 /// </summary>
 /// <param name="key">used to reference the added layer in other game objects</param>
 /// <param name="sortIndex">
 /// sort position in reference to the default 0, layers are drawn from lowest to highest
 /// </param>
 public Layer Add(string key, int sortIndex)
 {
     var layer = new Layer(key, sortIndex);
     _layers.Add(layer);
     _layers.Sort((a, b) => a.SortIndex.CompareTo(b.SortIndex));
     LayerAdded?.Invoke(this, new LayerAddedEvent(layer));
     return layer;
 }
Esempio n. 2
0
 public LayerAddedEvent(Layer layer)
 {
     Layer = layer;
 }
Esempio n. 3
0
 public LayerManager()
 {
     _defaultLayer = new Layer("default", 0);
     _layers.Add(_defaultLayer);
 }
Esempio n. 4
0
 public LayerAddedEvent(Layer layer)
 {
     Layer = layer;
 }