Example #1
0
        public Wallaby(
            System.Guid _id,
            rugby_sim.Grassland _layer,
            Mars.Interfaces.Layer.RegisterAgent _register,
            Mars.Interfaces.Layer.UnregisterAgent _unregister,
            Mars.Components.Environments.SpatialHashEnvironment <Wallaby> _WallabyEnvironment,
            int speed
            , double xcor = 0, double ycor = 0, int freq = 1)
        {
            _Grassland = _layer;
            ID         = _id;
            Position   = Mars.Interfaces.Environment.Position.CreatePosition(xcor, ycor);
            _Random    = new System.Random(ID.GetHashCode());
            this.speed = speed;
            _Grassland._WallabyEnvironment.Insert(this);
            _register(_layer, this, freq);
            _isAlive            = true;
            _executionFrequency = freq;
            {
                new System.Func <System.Tuple <double, double> >(() => {
                    var _taget15_245 = new System.Tuple <int, int>(_Random.Next(250),
                                                                   5);

                    var _object15_245 = this;

                    _Grassland._WallabyEnvironment.PosAt(_object15_245,
                                                         _taget15_245.Item1, _taget15_245.Item2
                                                         );
                    return(new Tuple <double, double>(Position.X, Position.Y));
                }).Invoke();
                has_ball = true;
                speed    = 1
                ;
            }
        }
Example #2
0
        public AllBlack(
            System.Guid _id,
            rugby_sim.Grassland _layer,
            Mars.Interfaces.Layer.RegisterAgent _register,
            Mars.Interfaces.Layer.UnregisterAgent _unregister,
            Mars.Components.Environments.SpatialHashEnvironment <AllBlack> _AllBlackEnvironment,
            double speed
            , double xcor = 0, double ycor = 0, int freq = 1)
        {
            _Grassland = _layer;
            ID         = _id;
            Position   = Mars.Interfaces.Environment.Position.CreatePosition(xcor, ycor);
            _Random    = new System.Random(ID.GetHashCode());
            this.speed = speed;
            _Grassland._AllBlackEnvironment.Insert(this);
            _register(_layer, this, freq);
            _isAlive            = true;
            _executionFrequency = freq;
            {
                System.Console.WriteLine("Initializing");;
                new System.Func <System.Tuple <double, double> >(() => {
                    var _taget49_637 = new System.Tuple <int, int>(_Random.Next(200),
                                                                   _Random.Next(10)
                                                                   );

                    var _object49_637 = this;

                    _Grassland._AllBlackEnvironment.PosAt(_object49_637,
                                                          _taget49_637.Item1, _taget49_637.Item2
                                                          );
                    return(new Tuple <double, double>(Position.X, Position.Y));
                }).Invoke();
                speed = 0.2
                ;
            }
        }