private void load() { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; Child = new Container { RelativeSizeAxes = Axes.X, Height = 50, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Honeydew, }, new Container { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, RelativeSizeAxes = Axes.Y, Width = 100, Child = new AutoSizeButton { RelativeSizeAxes = Axes.Both, Text = @"Añadir evento", Action = toggleAvailableEvents, }, }, possibleEventsList = new EventListContainer(), }, }; currentEditing.BindTo(editor.CurrentEditingElement); currentEditing.BindValueChanged(obj => showAvailableEvents(obj.NewValue), true); }
static Engine InitializeEngine() { var actions = new List <(string, Event)>(); EventListContainer eventList = new EventListContainer(); Engine engine = new Engine(actions, eventList); actions.Add(("make healthy", new GuaranteedEvent( delegate(Node n, Graph l, Graph w) { List <string> tStatus = engine.player.selectedNode.statuses; tStatus.Add("Healthy"); tStatus.Remove("Infected"); tStatus.Remove("Dead"); tStatus.Remove("Recovered"); } ))); actions.Add(("Make infected", new GuaranteedEvent( delegate(Node n, Graph l, Graph w) { List <string> tStatus = engine.player.selectedNode.statuses; Dictionary <string, int> tTrait = engine.player.selectedNode.traits; tStatus.Remove("Healthy"); tStatus.Add("Infected"); tStatus.Remove("Dead"); tStatus.Remove("Recovered"); tTrait.Add("Infected Time", 0); tTrait.Add("Medicinal Support", 100); tTrait.Add("Viral Intensity", Node.rng.NextGaussian(100, 10)); } ))); actions.Add(("Make dead", new GuaranteedEvent( delegate(Node n, Graph l, Graph w) { List <string> tStatus = engine.player.selectedNode.statuses; tStatus.Remove("Healthy"); tStatus.Remove("Infected"); tStatus.Add("Dead"); tStatus.Remove("Recovered"); } ))); actions.Add(("Make recovered", new GuaranteedEvent(delegate(Node n, Graph l, Graph w) { List <string> tStatus = engine.player.selectedNode.statuses; tStatus.Remove("Healthy"); tStatus.Remove("Infected"); tStatus.Remove("Dead"); tStatus.Add("Recovered"); }))); List <Event> personEvents = PersonEvents.InitializePersonEvents(); List <Event> districtEvents = PersonEvents.InitializeDistrictEvents(); List <Event> cityEvents = PersonEvents.InitializeCityEvents(); eventList.AddEventList(typeof(Person), personEvents); eventList.AddEventList(typeof(District), districtEvents); eventList.AddEventList(typeof(City), cityEvents); return(engine); }
static void Main() { Graph g = new Graph(); EventListContainer c = new EventListContainer(); c.AddEventList(typeof(DrawNode), new List <Event>()); Engine e = new Engine(new List <(string, Event)>(), c); Random r = new Random(); using (var game = new Renderer(g, e)) game.Run(); }