コード例 #1
0
ファイル: KolonizationMonitor.cs プロジェクト: sh1pman/MKS
        private void TransferSetup()
        {
            if (!HighLogic.LoadedSceneIsFlight)
            {
                return;
            }

            activeId = FlightGlobals.ActiveVessel.id;
            var PotentialVessels = LogisticsTools.GetNearbyVessels(150, true, FlightGlobals.ActiveVessel, true);

            NearVessels = new List <Vessel>();
            foreach (var v in PotentialVessels)
            {
                if (HasResources(v))
                {
                    NearVessels.Add(v);
                }
            }

            if (NearVessels.Count == 0)
            {
                return;
            }

            _crewPresent = NearVessels.Any(v => v.GetCrewCount() > 0);
            _fromVessel  = new TransferVessel();
            _fromVessel.Setup(NearVessels[0], 0);
            var lastIdx = NearVessels.Count - 1;

            _toVessel = new TransferVessel();
            _toVessel.Setup(NearVessels[lastIdx], lastIdx);
            _resList = RebuildResourceList();
        }
コード例 #2
0
ファイル: ManualLocalLogistics.cs プロジェクト: voicey99/MKS
        private void TransferSetup()
        {
            if (!HighLogic.LoadedSceneIsFlight)
            {
                return;
            }

            _activeVesselIdOnLastTransferSetup = FlightGlobals.ActiveVessel.id;

            if ((_participatingVessels == null) || (_participatingVessels.Count == 0))
            {
                _crewPresent           = false;
                _fromVessel            = null;
                _toVessel              = null;
                _transferableResources = null;
            }
            else
            {
                _crewPresent = _participatingVessels.Any(v => v.GetCrewCount() > 0);
                _fromVessel  = new TransferVessel();
                _fromVessel.Setup(_participatingVessels[0], 0);
                var lastIdx = _participatingVessels.Count - 1;
                _toVessel = new TransferVessel();
                _toVessel.Setup(_participatingVessels[lastIdx], lastIdx);
                _transferableResources = RebuildResourceList();
            }
        }
コード例 #3
0
ファイル: ManualLocalLogistics.cs プロジェクト: voicey99/MKS
        private void SetNextVessel(TransferVessel v)
        {
            var idx = v.Idx + 1;

            if (idx == _participatingVessels.Count)
            {
                idx = 0;
            }

            v.Setup(_participatingVessels[idx], idx);
            if (_fromVessel.Idx == _toVessel.Idx && _participatingVessels.Count > 1)
            {
                SetNextVessel(v);
            }

            _transferableResources = RebuildResourceList();
        }
コード例 #4
0
ファイル: KolonizationMonitor.cs プロジェクト: sh1pman/MKS
        private void SetNextVessel(TransferVessel v)
        {
            var idx = v.Idx + 1;

            if (idx == NearVessels.Count)
            {
                idx = 0;
            }

            v.Setup(NearVessels[idx], idx);
            if (_fromVessel.Idx == _toVessel.Idx && NearVessels.Count > 1)
            {
                SetNextVessel(v);
            }

            _resList = RebuildResourceList();
        }
コード例 #5
0
ファイル: KolonizationMonitor.cs プロジェクト: sh1pman/MKS
        private void SetPrevVessel(TransferVessel v)
        {
            var idx = v.Idx - 1;

            if (idx < 0)
            {
                idx = NearVessels.Count - 1;
            }

            v.Setup(NearVessels[idx], idx);
            _resList = RebuildResourceList();

            if (_fromVessel.Idx == _toVessel.Idx && NearVessels.Count > 1)
            {
                SetPrevVessel(v);
            }
        }
コード例 #6
0
ファイル: KolonizationMonitor.cs プロジェクト: BobPalmer/MKS
        private void TransferSetup()
        {
            if (!HighLogic.LoadedSceneIsFlight)
                return;

            activeId = FlightGlobals.ActiveVessel.id;
            var PotentialVessels = LogisticsTools.GetNearbyVessels(150, true, FlightGlobals.ActiveVessel, true);
            NearVessels = new List<Vessel>();
            foreach (var v in PotentialVessels)
            {
                if(HasResources(v))
                    NearVessels.Add(v);
            }

            if (NearVessels.Count == 0)
                return;

            _crewPresent = NearVessels.Any(v => v.GetCrewCount() > 0);
            _fromVessel = new TransferVessel();
            _fromVessel.Setup(NearVessels[0], 0);
            var lastIdx = NearVessels.Count - 1;
            _toVessel = new TransferVessel();
            _toVessel.Setup(NearVessels[lastIdx], lastIdx);
            _resList = RebuildResourceList();
        }
コード例 #7
0
ファイル: KolonizationMonitor.cs プロジェクト: BobPalmer/MKS
        private void SetPrevVessel(TransferVessel v)
        {
            var idx = v.Idx - 1;
            if (idx < 0)
                idx = NearVessels.Count - 1;

            v.Setup(NearVessels[idx],idx);
            _resList = RebuildResourceList();

            if (_fromVessel.Idx == _toVessel.Idx && NearVessels.Count > 1)
                SetPrevVessel(v);
        }