private void buttonCreateObject_Click(object sender, EventArgs e) { if (comboBoxMethodName.SelectedItem is FactoryMethodSelectionItem factoryMethod && comboBoxClassName.SelectedItem is FactoryClassSelectionItem factoryClass) { object result = factoryMethod.FactoryMethod.Invoke(Activator.CreateInstance(factoryClass.FactoryClass), argumentTable.Arguments.ToArray()); ObjectCreated?.Invoke(this, result); } }
public void Fire_ObjectCreated(StorageContext context, T obj) { ObjectCreated?.Invoke(context, new ObjectEventArgs <T>(obj)); }
public void OnObjectCreated(GameObject @object) => ObjectCreated?.Invoke(@object, EventArgs.Empty);
protected void InvokeObjectCreated(uint objId) => ObjectCreated?.Invoke(objId);
void InvokeObjectCreated(object created) { ObjectCreated?.Invoke(created); }
public ImgGalaxy(int id, Point pos, Point dir, int energy) : base(id, pos, dir, new Size(0, 0), energy) { image = Image.FromFile($"Resources/galaxy{Game.r.Next(4) + 1}.jpg"); OSize = new Size(image.Width, image.Height); ObjectCreated?.Invoke($"New galaxy created {id}, ({Pos.X},{Pos.Y}), speed: ({dir.X},{dir.Y})"); }
void InvokeObjectCreated(object obj) { ObjectCreated?.Invoke(obj); }
public Star(int id, Point pos, Point dir, Size size, int energy) : base(id, pos, dir, size, energy) { ObjectCreated?.Invoke($"New star created {id}, ({Pos.X},{Pos.Y}), speed: ({dir.X},{dir.Y})"); }