public void execute(ScopesManager sm) { IComposite variable = sm.GetMyType(varType); if (variable != null) { var tmp = Prototype.CloneObject(variable) as IComposite; tmp.Name = name; sm.declareVar(name, tmp); } else { throw new RuntimeException("Nie ma takiego typu"); } }
public void execute(ScopesManager sm) { IComposite variable = sm.GetMyType(varType); Composite collection = new Composite(name); if (variable == null) { throw new RuntimeException("Nie ma takiego typu"); } for (int i = 0; i < count; ++i) { IComposite tmp2 = Prototype.CloneObject(variable) as IComposite; tmp2.Position += new SFML.System.Vector2f(i * 30.0f, i * 30.0f); collection.Add(tmp2); } sm.declareVar(name, collection); }