Example #1
0
        public bool SetPort(IPort port)
        {
            _portName        = port.Name;
            _portX           = port.PositionX;
            _portY           = port.PositionY;
            _currentX        = port.PositionX;
            _currentY        = port.PositionY;
            _currentLocation = DroneLocation.Warehouse;
            _currentState    = DroneState.ReadyToCollect;

            return(true);
        }
Example #2
0
        /// <summary>
        /// What to do when the drone has reached the destination
        /// </summary>
        private void ReachedDestination()
        {
            if (_toPort)
            {
                _currentState    = DroneState.ReadyToCollect;
                _currentLocation = DroneLocation.Warehouse;
                Communicaiton.Instance.SetDroneDocked(Id);
            }

            if (!_toPort)
            {
                CompleteOrder();
                GoToPort();
            }
        }
Example #3
0
 /// <summary>
 /// Forcefully overwrites the current location with a new one, bypassing any checks
 /// </summary>
 /// <param name="newLocation"></param>
 public void OverwriteCurrentLocation(DroneLocation newLocation)
 {
     _currentLocation = newLocation;
 }