示例#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;
 }