コード例 #1
0
        private void InitFields()
        {
            _transform = transform;
            try
            {
                _pirate = GetComponent <IPirate>();
            }
            catch
            {
                throw new NullReferenceException("No component that implements the IFactoryLevel interface was found.");
            }

            try
            {
                _wheel = _spaceshipWheel.GetComponent <IWheel>();
            }
            catch
            {
                throw new NullReferenceException("Wheel field must not be null.");
            }

            try
            {
                _motor = _spaceshipMotor.GetComponent <IMotor>();
            }
            catch
            {
                throw new NullReferenceException("No component that implements the IMotor interface was found.");
            }
        }
コード例 #2
0
 private static void ensureRoverIsDeployed(IPirate pirate)
 {
     if (!pirate.IsDeployed())
     {
         throw new ReportException("Rapor oluşturulamamıştır.");
     }
 }
コード例 #3
0
        public List <ICargo> DeliverCargo(IPirate pirate)
        {
            var tempCargo = _cargos;

            pirate.StealCargos(_cargos);
            _cargos.Clear();
            return(tempCargo);
        }
コード例 #4
0
ファイル: Factory.cs プロジェクト: KiritoMC03/Planets-Colony
        public void SendCargo(IPirate pirate, Resource.Type resourceType)
        {
            var tempCargo = _cargoGenerator.GenerateCargo(resourceType,
                                                          _minGeneratedResource,
                                                          _maxGeneratedResource,
                                                          MultiplierCalculator.CalculateGeneratedResourceMultiplier(_factoryLevel.GetLevel()));

            pirate.StealCargo(tempCargo);
            IsRobbed = true;
        }
コード例 #5
0
        private void Awake()
        {
            _pirate = _piratePrefab.GetComponent <IPirate>();
            _guide  = _pirateGuide.GetComponent <IPirateGuide>();
            if (_pirate == null)
            {
                throw new NullReferenceException("Pirate Prefab field ERROR. No component that implements the IPirate interface was found.");
            }
            if (_guide == null)
            {
                throw new NullReferenceException("Pirate Guide field ERROR. No component that implements the IPirateGuide interface was found.");
            }

            if (_centralSun == null)
            {
                throw new Exception("Central Sun field must not be null.");
            }
        }
コード例 #6
0
 public void SetReceivers(IPirate _pirate, ISurface _Surface)
 {
     pirate  = _pirate;
     Surface = _Surface;
 }
コード例 #7
0
 public void SetReceiver(IPirate _pirate)
 {
     pirate = _pirate;
 }