public void SetComponents(Context context) { UnderlyingContext = context; Canvas = context.Canvas; InputController = context.InputController; AssetManager = context.AssetManager; StorageManager = context.StorageManager; }
protected override bool IntegrateChild(AssetManager assets, LayoutTreeNode childNode) { switch (childNode.Key) { case "InitialContext": for (int i = 0; i < contexts.Count; i++) { if (contexts[i].LayoutName == childNode.Value) { currentContext = i; return true; } } Console.WriteLine("LayoutEngine WARNING: Couldn't find a context named {0}. Make sure the context has been created first.", childNode.Value); return true; case "Contexts": Context gameContext = new Context(); gameContext.AssetManager = assets; gameContext.Canvas = canvas; gameContext.InputController = input; gameContext.StorageManager = storage; gameContext.Integrate(assets, childNode); contexts.Add(gameContext); return true; } return false; }