public override void ThrowPushEvent() { //Test the class with an already known type -- string XMLEngine<string>.SaveToFile("testXMLEngineExample.xml", "example string data"); //load it and output to log to test that too. Gears.Cloud._Debug.Debug.Out(XMLEngine<string>.LoadFromFile("testXMLEngineExample.xml")); //Test a custom-made type -- our example Map! Map map = new Map(); PopulateExampleMap(ref map); XMLEngine<Map>.SaveToFile("testXMLEngineMapExample.xml", map); }
public override void ThrowPushEvent() { Menu menu = new Menu(); MenuElement backMenuElement = new MenuElement(); backMenuElement.SetThrowPushEvent(new Action(() => { Master.Pop(); })); backMenuElement.ActiveArea = new Rectangle(100, 200, 300, 100); backMenuElement.ForegroundColor = Color.Aquamarine; backMenuElement.BackgroundColor = Color.Indigo; backMenuElement.MenuText = "Back"; backMenuElement.Selectable = true; backMenuElement.Hidden = false; backMenuElement.SpriteFont = @"Fonts\MenuItem"; MenuElement exitMenuElement = new MenuElement(); exitMenuElement.SetThrowPushEvent(new Action(() => { Master.GetGame().Exit(); })); exitMenuElement.ActiveArea = new Rectangle(100, 450, 300, 100); exitMenuElement.ForegroundColor = Color.Azure; exitMenuElement.ActiveForegroundColor = Color.Gold; exitMenuElement.BackgroundColor = Color.AntiqueWhite; exitMenuElement.ActiveBackgroundColor = Color.LightCyan; exitMenuElement.Hidden = false; exitMenuElement.MenuText = "Exit Game"; exitMenuElement.Selectable = true; exitMenuElement.SpriteFont = @"Fonts\MenuItem"; exitMenuElement.Texture2D = @"Debug\Collision\collisionUnitA"; List <MenuElement> menuElements = new List <MenuElement>(); menuElements.Add(backMenuElement); menuElements.Add(exitMenuElement); menu.AddMenuElements(menuElements); XMLEngine <Menu> .SaveToFile("testSaveMenu-001.xml", menu); }