public FieldSystem(Field field, PrintCharTable table) : base(field) { this.field = field; this.table = table; values = new int [xSize, ySize]; }
public Ant(Field field, int x, int y, int generation ) { this.field = field; this.x = x; this.y = y; this.generation = generation; }
public FlowSystem( Field field, PrintCharTable table, int dropAmount = DROP_AMOUNT, int dropMin = DROP_MIN, int dropMax = DROP_MAX, int initLimit = INIT_LIMIT, int maxDelta = MAX_DELTA ) : base(field, table) { this.maxDelta = maxDelta; // dropping initial shafts of water for (int i=0; i<dropAmount; i++) { int size = rnd.Next (dropMin, dropMax); values [field.randomX (), field.randomY ()] = size; } // to some OK position for (int i=0; i<initLimit; i++) if (!PerformFlow ()) break; }
public Ant(Field field, int x, int y) { this.field = field; this.x = x; this.y = y; this.generation = 0; }
public override void Happen(Field field) { ConstructorInfo constructor = fieldObjectType.GetConstructor( new Type[] { typeof(Field), typeof(int), typeof(int) } ); FieldObject newObject = (FieldObject)constructor.Invoke (new object [] { field, field.randomX (), field.randomY () } ); // newObject.x = field.randomX (); // newObject.y = field.randomY (); // newObject.field = field; field.AddFieldObject (newObject); }
public Fire(Field field, int x, int y) { this.field = field; this.x = x; this.y = y; }
public abstract void Happen(Field field);
public Carcass(Field field, int x, int y) { this.field = field; this.x = x; this.y = y; }
public FieldController(int turnLimit = 100) { this.turnLimit = turnLimit; this.field = new Field (); this.field.AddFieldObject (new Ant (field, field.randomX(), field.randomY())); }
public FieldObject(Field field, int x, int y) { this.field = field; this.x = x; this.y = y; }