コード例 #1
0
        public virtual void PrepareToSlot(Point pickup_point, Rack rack, int quantity)
        {
            _path  = AStarPathfinding.FindPath(_location, pickup_point, out _noPath, true);
            _state = robot_state.slot;

            _order._rack       = rack;
            _order._quantity   = quantity;
            _destination_point = pickup_point;
        }
コード例 #2
0
 public virtual void ResumeActivityLastDay()
 {
     if (_backUpState != robot_state.free)
     {
         _state       = _backUpState;
         _backUpState = robot_state.free;
         _path        = AStarPathfinding.FindPath(_location, _destination_point, out _noPath);
         Program.Print("Resume: " + _id + " " + _backUpState + " " + _destination_point + "\n");
     }
 }
コード例 #3
0
        public virtual void PrepareToPick(Point pickup_point, Rack rack, string product_id, int quantity)
        {
            _path  = AStarPathfinding.FindPath(_location, pickup_point, out _noPath, true);
            _state = robot_state.pick;

            _order._rack       = rack;
            _order._productID  = product_id;
            _order._quantity   = quantity;
            _destination_point = pickup_point;
        }
コード例 #4
0
 public void init()
 {
     GameObject[] _rbs = GameObject.FindGameObjectsWithTag("robot");
     //get all the robots I am controlling
     my_robots = new List <Robot_behave>();
     foreach (GameObject _rb in _rbs)
     {
         my_robots.Add(_rb.GetComponent <Robot_behave>());
     }
     sg       = GridsGenerator.instance.g;
     my_state = robot_state.defeat;
 }
コード例 #5
0
        public Robot(int x, int y, Byte id)
        {
            _id = id;
            _chargingPoint.X   = x;
            _chargingPoint.Y   = y;
            _location          = _chargingPoint;
            _destination_point = _chargingPoint;
            _direction         = Direction.Up;
            _actionString      = "";
            _backUpState       = robot_state.free;
            _state             = robot_state.free;
            _path = new Stack <Point>();
            Warehouse.Map[y, x] = 1;

            _order  = new Order();
            _noPath = false;
        }
コード例 #6
0
    public void update_state(robot_state r, evador_behave target = null)
    {
        //robots current positions

        switch (r)
        {
        case robot_state.defeat:
            corner_target(target);
            return;

        case robot_state.cooperate:
            if (player_target.Count == 0)
            {
                create_target_list();
            }
            refresh_target_list();
            evador_behave target_evador = Find_target(player_target);
            corner_target(target_evador);
            return;
        }
        //target
    }
コード例 #7
0
 // Use this for initialization
 void Start()
 {
     my_state = robot_state.hang;
 }