public virtual void Show() { EntityGame.SwitchState(this); if (ShownEvent != null) { ShownEvent(this); } switch (InitializeActionOnShow) { case InitializeAction.OnceInLife: if (!Initialized) { Initialize(); } break; case InitializeAction.OncePerShow: Initialize(); break; } EntityGame.Log.Write("Shown", this, Alert.Info); }
public event EventHandler ChildAdded, ChildRemoved; //Called only if this node had AddChild called public Node(Node parent, string name) { Id = EntityGame.GetID(); Name = name; Active = true; Visible = true; SetParent(parent); //This virtual member call in the constructor is OK because we only use members initialized in this class. Recycled = false; }
/// <summary> /// Used to initialize EntityGame singleton /// </summary> /// <param name="game"></param> /// <param name="spriteBatch"></param> public static void MakeGame(Game game, SpriteBatch spriteBatch) { Self = new EntityGame(game, spriteBatch); Self.Name = "EntityGame"; Self.Id = 0; }
/// <summary> /// Used to initalize EntityGame singleton /// </summary> /// <param name="game"></param> /// <param name="g"></param> /// <param name="spriteBatch"></param> /// <param name="viewport"></param> public static void MakeGame(Game game, GraphicsDeviceManager g, SpriteBatch spriteBatch, Rectangle viewport) { Self = new EntityGame(game, g, spriteBatch, viewport); Self.Name = "EntityGame"; Self.Id = 0; }