Пример #1
0
 public FieldSystem(Field field, PrintCharTable table)
     : base(field)
 {
     this.field = field;
     this.table = table;
     values = new int [xSize, ySize];
 }
Пример #2
0
 public Ant(Field field, int x, int y, int generation )
 {
     this.field = field;
     this.x = x;
     this.y = y;
     this.generation = generation;
 }
Пример #3
0
        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;
        }
Пример #4
0
 public Ant(Field field, int x, int y)
 {
     this.field = field;
     this.x = x;
     this.y = y;
     this.generation = 0;
 }
Пример #5
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);
 }
Пример #6
0
 public Fire(Field field, int x, int y)
 {
     this.field = field;
     this.x = x;
     this.y = y;
 }
Пример #7
0
 public abstract void Happen(Field field);
Пример #8
0
 public Carcass(Field field, int x, int y)
 {
     this.field = field;
     this.x = x;
     this.y = y;
 }
Пример #9
0
 public FieldController(int turnLimit = 100)
 {
     this.turnLimit = turnLimit;
     this.field = new Field ();
     this.field.AddFieldObject (new Ant (field, field.randomX(), field.randomY()));
 }
Пример #10
0
 public FieldObject(Field field, int x, int y)
 {
     this.field = field;
     this.x = x;
     this.y = y;
 }