Ejemplo n.º 1
0
        public void should_not_match_not_inheritor([Values(null, "tag")] object tag)
        {
            var unitId = new UnitId(typeof(MemoryStream), tag);
            var target = new IsInheritorOf(typeof(IEnumerable), tag);

            target.Matches(unitId).Should().BeFalse();
        }
Ejemplo n.º 2
0
        public void should_match_any_tag_if_specified([Values(null, "tag")] object tag)
        {
            var unitId = new UnitId(typeof(MemoryStream), tag);
            var target = new IsInheritorOf(typeof(Stream), SpecialTag.Any);

            target.Matches(unitId).Should().BeTrue();
        }
Ejemplo n.º 3
0
        public void should_match_value_type_as_inheritor_of_object([Values(null, "tag")] object tag)
        {
            var unitId = new UnitId(typeof(int), tag);
            var target = new IsInheritorOf(typeof(object), tag);

            target.Matches(unitId).Should().BeTrue();
        }
Ejemplo n.º 4
0
        public void should_match_interface([Values(null, "tag")] object tag)
        {
            var unitId = new UnitId(typeof(MemoryStream), tag);
            var target = new IsInheritorOf(typeof(IDisposable), tag);

            target.Matches(unitId).Should().BeTrue();
        }
Ejemplo n.º 5
0
        public EmployeeUnit(Employee employee, Unit unit, DateTime fromDate, DateTime toDate, int workTimePercent, int unitWeight, List <EmployeeUnitCustomFieldValue> employeeUnitCustomFieldValue)
        {
            if (unit == null)
            {
                throw new ArgumentNullException("unit");
            }
            if (unit.Id == null)
            {
                throw new ArgumentNullException("unit.Id");
            }
            if (employee == null)
            {
                throw new ArgumentNullException("employee");
            }

            unitId = unit.Id;
            this.workTimePercent = workTimePercent;
            this.unitWeight      = unitWeight;
            this.fromDate        = fromDate;
            this.toDate          = toDate.Date;
            this.employee        = employee;
            employeeNo           = employee.Id.EmployeeNo;
            if (employeeUnitCustomFieldValue != null)
            {
                this.employeeUnitCustomFieldValues = employeeUnitCustomFieldValue;
            }
        }
Ejemplo n.º 6
0
        public bool IsValidCustomFieldIdList(UnitId unitId, IList <CustomFieldTypeId> customFieldTypeIds)
        {
            var unit            = unitRep.GetById(unitId);
            var customFieldList = customFieldRep.Find(customFieldTypeIds);

            return(unit.IsValidCustomFields(customFieldList));
        }
Ejemplo n.º 7
0
 protected AUnit(Empire empire, UnitId id)
 {
     TheEmpire          = empire;
     Id                 = id;
     Data               = empire.Data->UnitsData[id];
     CachedPersistentId = PersistentId;
 }
Ejemplo n.º 8
0
        /// <summary> </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            string localStatus = "FAILED";

            ActivityStatus.Set(context, localStatus);
            string sSpatialRegistrationObjectType = "";
            int    nPatientID       = 0;
            string sManfacturer     = "";
            string sModel           = "";
            string sSoftwareVersion = "";
            string sModality        = "";
            string _dcmInstanceId   = UnitId.Get(context);
            int    nDcmInstanceId   = Convert.ToInt32(_dcmInstanceId);

            context.GetExtension <CompositionContainer>().SatisfyImportsOnce(this);
            try
            {
                _processSpatialRegistrationObject.RetrieveSpatialRegistrationDetails(nDcmInstanceId, ref nPatientID, ref sManfacturer, ref sModel, ref sSoftwareVersion, ref sModality, ref sSpatialRegistrationObjectType);
                if (nPatientID > 0)
                {
                    localStatus = "SUCCESS";
                }
                SpatialRegistrationObjectType.Set(context, sSpatialRegistrationObjectType);
                PatientID.Set(context, nPatientID);
                Manufacturer.Set(context, sManfacturer);
                Model.Set(context, sModel);
                SoftwareVersion.Set(context, sSoftwareVersion);
                Modality.Set(context, sModality);
                ActivityStatus.Set(context, localStatus);
            }
            catch (Exception e)
            {
                ActivityStatus.Set(context, localStatus);
            }
        }
Ejemplo n.º 9
0
        public void should_not_send_the_rest_to_children_if_no_unit_matched()
        {
            var expected1 = new UnitId("expected", "expected");
            var expected2 = new UnitId("expected1l", "expected");

            // --arrange
            var target = new SkipTillUnit(new UnitPattern("absent"));
            var child1 = A.Fake <IBuildChainPattern>();
            var child2 = A.Fake <IBuildChainPattern>();

            target.AddNode(child1);
            target.AddNode(child2);

            // --act
            var chain = new[] { new UnitId(1, null), new UnitId(2, null), expected1, expected2 }.ToArrayTail();
            WeightedBuildActionBag?actionBag;

            target.GatherBuildActions(chain, out actionBag, 0);

            // --assert
            WeightedBuildActionBag?weightedBuildActionBag;

            A.CallTo(() => child1.GatherBuildActions(An <BuildChain> ._, out weightedBuildActionBag, An <int> ._)).WithAnyArguments().MustNotHaveHappened();
            WeightedBuildActionBag?actionBag1;

            A.CallTo(() => child2.GatherBuildActions(An <BuildChain> ._, out actionBag1, An <int> ._)).WithAnyArguments().MustNotHaveHappened();
        }
Ejemplo n.º 10
0
        public Unit UpdateUnit(UnitId unitId, List <SharedUnitCustomFieldId> customFieldIdList, IList <UnitIndexForUnit> unitIndexList)
        {
            using (var tr = new TransactionScope())
            {
                var unit = unitRep.GetBy(unitId);
                var sharedUnitCustomFields = ipmsAdminService.GetSharedCutomFieldListForUnit(unitId.SharedUnitId, customFieldIdList);

                var unitCustomFields = new List <UnitCustomField>();
                foreach (var sharedUnitCustomField in sharedUnitCustomFields)
                {
                    unitCustomFields.Add(new UnitCustomField(new UnitCustomFieldId(unitId.PeriodId, sharedUnitCustomField.Id, unitId.SharedUnitId),
                                                             sharedUnitCustomField
                                                             ));
                }
                unit.UpdateCustomFields(unitCustomFields, periodChecker);
                var unitindexIdList = unitIndexList.Select(jj => jj.UnitIndexId).ToList();
                var unitIndices     = unitIndexRep.FindUnitIndices(unitindexIdList);

                var unitUnitIndices = new List <UnitUnitIndex>();
                foreach (var unitIndex in unitIndices)
                {
                    var unitindexForUnit = unitIndexList.Single(j => j.UnitIndexId == unitIndex.Id);
                    unitUnitIndices.Add(new UnitUnitIndex(unitIndex.Id, unitindexForUnit.ShowforTopLevel, unitindexForUnit.ShowforSameLevel, unitindexForUnit.ShowforLowLevel));
                }
                unit.UpdateUnitIndices(unitUnitIndices, periodChecker);
                tr.Complete();
                return(unit);
            }
        }
Ejemplo n.º 11
0
        public virtual void Update(Period period, Job job, Unit unit, JobPosition parent)
        {
            if (period == null || period.Id == null)
            {
                throw new ArgumentNullException("period");
            }
            period.CheckModifyingJobPosition();

            if (job == null || job.Id == null)
            {
                throw new ArgumentNullException("job");
            }
            if (unit == null || unit.Id == null)
            {
                throw new ArgumentNullException("unit");
            }


            if (!period.Id.Equals(job.Id.PeriodId))
            {
                throw new JobPositionCompareException("JobPosition", "Job", "Period");
            }

            if (!period.Id.Equals(unit.Id.PeriodId))
            {
                throw new JobPositionCompareException("JobPosition", "Unit", "Period");
            }

            this.parent = parent;
            unitId      = unit.Id;
            jobId       = job.Id;
        }
Ejemplo n.º 12
0
        public override int GetHashCode()
        {
            int hashCode = 1803674884;

            hashCode = hashCode * -1521134295 + Id.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name);

            hashCode = hashCode * -1521134295 + IsIntermediate.GetHashCode();
            hashCode = hashCode * -1521134295 + IsDanger.GetHashCode();
            hashCode = hashCode * -1521134295 + IsProduction.GetHashCode();
            hashCode = hashCode * -1521134295 + IsActive.GetHashCode();
            hashCode = hashCode * -1521134295 + IntermediateNrD.GetHashCode();
            hashCode = hashCode * -1521134295 + ClpSignalWordId.GetHashCode();
            hashCode = hashCode * -1521134295 + ClpMsdsId.GetHashCode();
            hashCode = hashCode * -1521134295 + FunctionId.GetHashCode();
            hashCode = hashCode * -1521134295 + Price.GetHashCode();
            hashCode = hashCode * -1521134295 + CurrencyId.GetHashCode();
            hashCode = hashCode * -1521134295 + UnitId.GetHashCode();
            hashCode = hashCode * -1521134295 + Density.GetHashCode();
            hashCode = hashCode * -1521134295 + Solids.GetHashCode();
            hashCode = hashCode * -1521134295 + Ash450.GetHashCode();
            hashCode = hashCode * -1521134295 + VOC.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Remarks);

            hashCode = hashCode * -1521134295 + LoginId.GetHashCode();
            hashCode = hashCode * -1521134295 + DateCreated.GetHashCode();
            hashCode = hashCode * -1521134295 + DateUpdated.GetHashCode();
            return(hashCode);
        }
Ejemplo n.º 13
0
        private void AddUnit(UnitId unitId)
        {
            if (LUnitFilter.ContainsKey(unitId))
            {
                new AnotherMessageBox().Show(_lstrMaphackFilterMessageAddUnitText.ToString(), _lstrMaphackFilterMessageAddUnitHeader.ToString());

                var items = lstvMaphackBasicsUnitFilter.Items.Find(unitId.ToString(), false);

                if (items.Length <= 0)
                {
                    return;
                }

                foreach (ListViewItem item in lstvMaphackBasicsUnitFilter.Items)
                {
                    item.Selected = false;
                }

                items[0].Selected = true;

                return;
            }

            var cl = new Color().GetRandomColor();

            LUnitFilter.Add(unitId, cl);

            AddUnitsToListview();
            AddUnitToSettings(unitId, cl);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        /// <param name="bookmark"></param>
        /// <param name="obj"></param>
        protected override void OnBookmarkCallback(NativeActivityContext context, Bookmark bookmark, string obj)
        {
            var method = System.Reflection.MethodBase.GetCurrentMethod().Name;

            Debug.Assert(bookmark.Name == BookmarkName);

            context.GetExtension <CompositionContainer>().SatisfyImportsOnce(this);
            _logger.Log(EventSeverity.Debug, method, string.Format("[{0}] Enter: Finished Processing UnitId: [{1}], Bookmark name: [{2}]",
                                                                   Thread.CurrentThread.ManagedThreadId, UnitId.Get(context), bookmark.Name));

            string referencedSiteId = _processSpatialRegistrationObject.GetReferencedSiteId(Int32.Parse(UnitId.Get(context)));
            var    refFrameOfRefUid = _processSpatialRegistrationObject.GetReferencedFrameOfReferenceInfo(Int32.Parse(UnitId.Get(context)));

            if (referencedSiteId != "")
            {
                var tmpList = _processSpatialRegistrationObject.GetReferenceStructureSetDcmInstances(refFrameOfRefUid, referencedSiteId, Int32.Parse(UnitId.Get(context)));

                foreach (string rtssId in tmpList)
                {
                    _logger.Log(EventSeverity.Debug, method, string.Format("[{0}] Processing UnitId: [{1}], Found structure set id: [{2}]",
                                                                           Thread.CurrentThread.ManagedThreadId, UnitId.Get(context), rtssId));
                }
                OutStructureSetIds.Set(context, tmpList);

                OutUnitId.Set(context, UnitId.Get(context));
                _logger.Log(EventSeverity.Debug, method, string.Format("[{0}] Exit: Finished Processing UnitId: [{1}], Bookmark name: [{2}]",
                                                                       Thread.CurrentThread.ManagedThreadId, UnitId.Get(context), bookmark.Name));
            }
        }
Ejemplo n.º 15
0
 public Unit UppdateUnit(UnitId unitId, string name, string dictionaryName, IList <CustomFieldTypeId> customFieldTypeIdList)
 {
     try
     {
         using (var scope = new TransactionScope())
         {
             var unit             = unitRep.GetById(unitId);
             var unitCustomFields = customFieldRep.GetAll(EntityTypeEnum.Unit)
                                    .Where(c => customFieldTypeIdList.Contains(c.Id)).ToList();
             unit.Update(name, dictionaryName, unitCustomFields);
             unitRep.UpdateUnit(unit);
             scope.Complete();
             return(unit);
         }
     }
     catch (Exception exp)
     {
         var res = unitRep.TryConvertException(exp);
         if (res == null)
         {
             throw;
         }
         throw res;
     }
 }
Ejemplo n.º 16
0
        /// <summary> </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            string                  localStatus               = "FAILED";
            string                  _dcmInstanceId            = UnitId.Get(context);
            int                     nDcmInstanceId            = Convert.ToInt32(_dcmInstanceId);
            byte                    nRegistrationType         = RegistrationType.Get(context);
            string                  _manufacturer             = Manufacturer.Get(context);
            string                  _model                    = ModelName.Get(context);
            string                  _softwareVersion          = SoftwareVersions.Get(context);
            IList <string>          sourceFrameOfReferenceUid = SourceFrameOfReferenceUID.Get(context);
            string                  targetFrameOfReferenceUid = TargetFrameOfReferenceUID.Get(context);
            IList <IList <double> > transformationMatrix      = TransformationMatrix.Get(context);
            IList <string>          transformationComment     = TransformationMatrixComment.Get(context);
            string                  _offsetId                 = OffsetID.Get(context);
            int                     nOffsetId                 = 0;

            if (_offsetId.Length > 0)
            {
                nOffsetId = Convert.ToInt32(_offsetId);
            }

            context.GetExtension <CompositionContainer>().SatisfyImportsOnce(this);

            try
            {
                _processSpatialRegistrationObject.CreateRegistrationRecord(nDcmInstanceId, transformationMatrix, transformationComment, sourceFrameOfReferenceUid, targetFrameOfReferenceUid, nRegistrationType, _manufacturer, _model, _softwareVersion, nOffsetId);
                localStatus = "SUCCESS";
                ActivityStatus.Set(context, localStatus);
            }
            catch (Exception ex)
            {
                ActivityStatus.Set(context, localStatus);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        protected override void BeforeDoWork(NativeActivityContext context)
        {
            var method = System.Reflection.MethodBase.GetCurrentMethod().Name;

            context.GetExtension <CompositionContainer>().SatisfyImportsOnce(this);

            _logger.Log(EventSeverity.Debug, method,
                        string.Format("[{0}] Processing UnitId: [{1}], Bookmark name: [{2}], Extension Recorded Id:[{3}]",
                                      Thread.CurrentThread.ManagedThreadId,
                                      UnitId.Get(context), BookmarkName, _processSpatialRegistrationObject.ConstructedBy));

            var registrationType        = SpatialRegistrationObjectType.Get(context);
            var planningSopInstanceUids = PlanningImageSopInstanceValues.Get(context);

            switch (registrationType)
            {
            case "2D":
                _processSpatialRegistrationObject.GetReferenced2DImageInfo(Int32.Parse(UnitId.Get(context)), planningSopInstanceUids);
                break;

            case "3D":
                _processSpatialRegistrationObject.GetReferenced3DImageInfo(Int32.Parse(UnitId.Get(context)), planningSopInstanceUids);
                break;
            }
        }
Ejemplo n.º 18
0
 public ImageComboItem(string text, Image image, UnitId unitId, Image backgroundImage)
 {
     Text = text;
     Image = image;
     UnitId = unitId;
     BackgroundImage = backgroundImage;
 }
Ejemplo n.º 19
0
 public IEnumerable <UnitImmutable> GetById(PlayerId playerId, UnitId unitId)
 {
     world.ValidatePlayer(playerId);
     return(Units(playerId)
            .Where(x => x.UnitId == unitId)
            .Select(x => x.ToImmutable()));
 }
Ejemplo n.º 20
0
 private void AddUnitToSettings(UnitId unitId)
 {
     if (!PSettings.PreferenceAll.OverlayAlert.UnitIds.Contains(unitId))
     {
         PSettings.PreferenceAll.OverlayAlert.UnitIds.Add(unitId);
     }
 }
Ejemplo n.º 21
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ClientToken.Length != 0)
            {
                hash ^= ClientToken.GetHashCode();
            }
            if (UnitId != 0UL)
            {
                hash ^= UnitId.GetHashCode();
            }
            if (KitId != 0)
            {
                hash ^= KitId.GetHashCode();
            }
            if (KitCustomNameId.Length != 0)
            {
                hash ^= KitCustomNameId.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 22
0
    public void Content()
    {
        const int startIndex = 2;

        // --arrange
        var array = new UnitId[] { new(0, null), new(1, null), new (2, 0), new(3, 0) };

        var expected = new UnitId[array.Length - startIndex];

        for (var i = startIndex; i < array.Length; i++)
        {
            expected[i - startIndex] = array[i];
        }

        // --act
        var actual = array.ToBuildChain().GetTail(startIndex);

        // --assert
        var actualArray = new UnitId[actual.Length];

        for (var i = 0; i < actual.Length; i++)
        {
            actualArray[i] = actual[i];
        }

        actualArray.Should().Equal(expected);
    }
Ejemplo n.º 23
0
    public void should_skip_all_units_but_the_last_one()
    {
        var expected = new UnitId("expected", "expected");

        // --arrange
        var target = new SkipAllUnits();
        var child1 = A.Fake <IBuildChainPattern>();
        var child2 = A.Fake <IBuildChainPattern>();

        target.AddNode(child1);
        target.AddNode(child2);

        // --act
        var chain = new[] { new UnitId(1, null), new UnitId(null, 2), new UnitId(3, null), expected }.ToArrayTail();
        WeightedBuildActionBag?actionBag;

        target.GatherBuildActions(chain, out actionBag, 0);

        // --assert
        WeightedBuildActionBag?weightedBuildActionBag;

        A.CallTo(() => child1.GatherBuildActions(An <BuildChain> .That.IsEqualTo(expected.ToArrayTail(), Comparer.OfArrayTail <UnitId>()), out weightedBuildActionBag, An <int> ._))
        .MustHaveHappenedOnceAndOnly();

        WeightedBuildActionBag?actionBag1;

        A.CallTo(() => child2.GatherBuildActions(An <BuildChain> .That.IsEqualTo(expected.ToArrayTail(), Comparer.OfArrayTail <UnitId>()), out actionBag1, An <int> ._))
        .MustHaveHappenedOnceAndOnly();
    }
Ejemplo n.º 24
0
        public void should_not_match_exact_type([Values(null, "tag")] object tag)
        {
            var unitId = new UnitId(typeof(Stream), tag);
            var target = new IsInheritorOf(typeof(Stream), tag);

            target.Matches(unitId).Should().BeFalse();
        }
Ejemplo n.º 25
0
 public ImageComboItem(string text, Image image, UnitId unitId, Image backgroundImage)
 {
     Text            = text;
     Image           = image;
     UnitId          = unitId;
     BackgroundImage = backgroundImage;
 }
        /// <summary> </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            string                  localStatus               = "FAILED";
            string                  _dcmInstanceId            = UnitId.Get(context);
            int                     nDcmInstanceId            = Convert.ToInt32(_dcmInstanceId);
            IList <string>          sourceFrameOfReferenceUid = new List <string>();
            string                  targetFrameOfReferenceUid = "";
            IList <IList <double> > transformationMatrix      = new List <IList <double> >();
            IList <string>          transformationComment     = new List <string>();
            byte                    nRegistrationType         = 0;

            context.GetExtension <CompositionContainer>().SatisfyImportsOnce(this);

            _processSpatialRegistrationObject.ParseTreatmentPlanningSpatialRegistration(nDcmInstanceId, ref sourceFrameOfReferenceUid, ref targetFrameOfReferenceUid, ref transformationMatrix, ref transformationComment, ref nRegistrationType);

            if (sourceFrameOfReferenceUid != null && sourceFrameOfReferenceUid.Count > 0)
            {
                localStatus = "SUCCESS";
            }

            SourceFrameOfReferenceUID.Set(context, sourceFrameOfReferenceUid);
            TargetFrameOfReferenceUID.Set(context, targetFrameOfReferenceUid);
            TransformationMatrix.Set(context, transformationMatrix);
            TransformationMatrixComment.Set(context, transformationComment);
            RegistrationType.Set(context, nRegistrationType);
            ActivityStatus.Set(context, localStatus);
        }
Ejemplo n.º 27
0
    public void should_match_first_unit_and_send_the_rest_to_children()
    {
        const string kind = "kind";

        var expected = new UnitId("expected", "expected");

        // --arrange
        var target = new IfFirstUnit(new UnitPattern(kind));
        var child1 = A.Fake <IBuildChainPattern>();
        var child2 = A.Fake <IBuildChainPattern>();

        target.AddNode(child1);
        target.AddNode(child2);

        // --act
        var chain = new[] { new UnitId(kind, null), expected }.ToArrayTail();

        target.GatherBuildActions(chain, out var actionBag, 0);

        // --assert
        A.CallTo(() => child1.GatherBuildActions(An <BuildChain> .That.IsEqualTo(expected.ToArrayTail(), Comparer.OfArrayTail <UnitId>()), out actionBag, An <int> ._))
        .MustHaveHappenedOnceAndOnly();

        A.CallTo(() => child2.GatherBuildActions(An <BuildChain> .That.IsEqualTo(expected.ToArrayTail(), Comparer.OfArrayTail <UnitId>()), out actionBag, An <int> ._))
        .MustHaveHappenedOnceAndOnly();
    }
Ejemplo n.º 28
0
        private void AddUnit(UnitId unitId)
        {
            if (PSettings.PreferenceAll.OverlayAlert.UnitIds.Contains(unitId))
            {
                new AnotherMessageBox().Show(_lstrMaphackFilterMessageAddUnitText.ToString(), _lstrMaphackFilterMessageAddUnitHeader.ToString());

                var items = lstvAlertConfigurationFilter.Items.Find(unitId.ToString(), false);

                if (items.Length <= 0)
                {
                    return;
                }

                foreach (ListViewItem item in lstvAlertConfigurationFilter.Items)
                {
                    item.Selected = false;
                }

                items[0].Selected = true;

                return;
            }

            AddUnitToSettings(unitId);
            AddUnitsToListview();
        }
Ejemplo n.º 29
0
 private void RemoveUnitFromSettings(UnitId unitId)
 {
     if (PSettings.PreferenceAll.OverlayAlert.UnitIds.Contains(unitId))
     {
         PSettings.PreferenceAll.OverlayAlert.UnitIds.Remove(unitId);
     }
 }
Ejemplo n.º 30
0
        public void should_not_match_if_tag_differs([Values(null, "kind")] object kind)
        {
            var unitInfo = new UnitId(kind, "tag1");
            var target   = new UnitPattern(kind, "tag2");

            // --assert
            target.Matches(unitInfo).Should().BeFalse();
        }
Ejemplo n.º 31
0
        public void should_not_match_if_kind_differs([Values(null, "tag")] object tag)
        {
            var unitInfo = new UnitId("kind1", tag);
            var target   = new UnitPattern("kind2", tag);

            // --assert
            target.Matches(unitInfo).Should().BeFalse();
        }
Ejemplo n.º 32
0
        public static Int32 CountUnitTypePerPlayer(List<Unit> lUnit, UnitId id, Int32 playerNumber)
        {
            var iBuildingCount = 0;
            for (var i = 0; i < lUnit.Count; i++)
            {
                if (lUnit[i].Id.Equals(id))
                    if (lUnit[i].Owner.Equals(playerNumber))
                        if (!lUnit[i].IsUnderConstruction)
                            iBuildingCount += 1;
            }

            return iBuildingCount;
        }
Ejemplo n.º 33
0
        private void AddUnit(UnitId unitId)
        {
            if (PSettings.PreferenceAll.OverlayAlert.UnitIds.Contains(unitId))
            {
                new AnotherMessageBox().Show(_lstrMaphackFilterMessageAddUnitText.ToString(), _lstrMaphackFilterMessageAddUnitHeader.ToString());

                var items = lstvAlertConfigurationFilter.Items.Find(unitId.ToString(), false);

                if (items.Length <= 0)
                    return;

                foreach (ListViewItem item in lstvAlertConfigurationFilter.Items)
                {
                    item.Selected = false;
                }

                items[0].Selected = true;

                return;
            }

            AddUnitToSettings(unitId);
            AddUnitsToListview();
        }
Ejemplo n.º 34
0
 public ImageComboItem(string text, Image image, UnitId unitId)
 {
     Text = text;
     Image = image;
     UnitId = unitId;
 }
Ejemplo n.º 35
0
        private void AddUnitToSettings(UnitId unitId, Color clColor)
        {
            var myParent = (NewMainHandler)this.FindParent(String.Empty, typeof(NewMainHandler));

            var index = myParent.PSettings.PreferenceAll.OverlayMaphack.UnitIds.FindIndex(x => x == unitId);

            if (index == -1)
            {
                myParent.PSettings.PreferenceAll.OverlayMaphack.UnitIds.Add(unitId);
                myParent.PSettings.PreferenceAll.OverlayMaphack.UnitColors.Add(clColor);
            }

            else
            {
                myParent.PSettings.PreferenceAll.OverlayMaphack.UnitIds[index] = unitId;
                myParent.PSettings.PreferenceAll.OverlayMaphack.UnitColors[index] = clColor;
            }
        }
Ejemplo n.º 36
0
        private void RemoveUnitFromSettings(UnitId unitId)
        {
            var myParent = (NewMainHandler)this.FindParent(String.Empty, typeof(NewMainHandler));

            var index = myParent.PSettings.PreferenceAll.OverlayMaphack.UnitIds.FindIndex(x => x == unitId);

            if (index == -1)
                return;

            myParent.PSettings.PreferenceAll.OverlayMaphack.UnitIds.RemoveAt(index);
            myParent.PSettings.PreferenceAll.OverlayMaphack.UnitColors.RemoveAt(index);
        }
Ejemplo n.º 37
0
 private void AddUnitToSettings(UnitId unitId)
 {
     if (!PSettings.PreferenceAll.OverlayAlert.UnitIds.Contains(unitId))
         PSettings.PreferenceAll.OverlayAlert.UnitIds.Add(unitId);
 }
Ejemplo n.º 38
0
        private List<UnitProduction> GetGUnitNumberOfQueuedUnit(Int32 iUnitNum, UnitId structureId)
        {
            _.Info("Assign Special Attributes Of Units", _.InfoImportance.Important);

            var lUnitIds = new List<UnitProduction>();

            /* Content of Abilities (pAbilities) */
            var iUnitAbilitiesPointer = Memory.ReadUInt32(MyOffsets.UnitStruct + 0xDC + MyOffsets.UnitStructSize * iUnitNum);
            /* BitConverter.ToUInt32(InteropCalls.Help_ReadProcessMemory(HStarcraft, MyOffsets.UnitStruct + 0xDC + MyOffsets.UnitStructSize * iUnitNum, 4), 0);*/

            /* Bitwise AND */
            iUnitAbilitiesPointer = iUnitAbilitiesPointer & 0xFFFFFFFC;

            var iAbilityCount = Memory.ReadInt16((int)iUnitAbilitiesPointer + 0x16);
            /*BitConverter.ToInt16(InteropCalls.Help_ReadProcessMemory(HStarcraft, (int)iUnitAbilitiesPointer + 0x16, 2),
                                 0);
            */

            /* Reading the Bytearray */

            /* Read the result of iUnitAbilitiesPointer (p1) */
            var iUnitAbilitiesPointerResult = Memory.ReadInt32(iUnitAbilitiesPointer);
            /*BitConverter.ToInt32(InteropCalls.Help_ReadProcessMemory(HStarcraft,
                                                                                             (int)iUnitAbilitiesPointer, 4),
                                                         0);*/

            /* Add 3 to that value */
            iUnitAbilitiesPointerResult += 3;

            try
            {
                Memory.ReadMemory(iUnitAbilitiesPointerResult, iAbilityCount);
            }

            catch
            {
                throw new Exception("If you read this, don't commit suicide! I f****d up - sorry.\n" +
                "Just report this thing!");
            }

            Int32 iIndexToLookAt = -1;
            var byteBuffer = Memory.ReadMemory(iUnitAbilitiesPointerResult, iAbilityCount);// InteropCalls.Help_ReadProcessMemory(HStarcraft, iUnitAbilitiesPointerResult, iAbilityCount);

            for (var i = 0; i < byteBuffer.Length; i++)
            {
            #if !DEBUG

                if (byteBuffer[i].Equals(0x19))
                {
                    iIndexToLookAt = i;

                    if (!structureId.Equals(UnitId.TbPlanetary))
                        break;
                }

            #else
                #region Debug/ Tests

                var _iContentOfPointer = Memory.ReadUInt32(iUnitAbilitiesPointer + 0x18 + 4*i);
                   /* BitConverter.ToUInt32(
                        InteropCalls.Help_ReadProcessMemory(HStarcraft, (Int32)iUnitAbilitiesPointer + 0x18 + 4 * i, 4),
                        0);*/

                // Number of queued Units
                var _iNumberOfQueuedUnits = Memory.ReadInt32(_iContentOfPointer + 0x28);
                    /*BitConverter.ToInt32(
                    InteropCalls.Help_ReadProcessMemory(HStarcraft, (Int32)_iContentOfPointer + 0x28, 4), 0);*/

                var _bReactorAttached = Memory.ReadInt32(_iContentOfPointer + 0x48);
                    /*BitConverter.ToInt32(
                InteropCalls.Help_ReadProcessMemory(HStarcraft, (Int32)_iContentOfPointer + 0x48, 4), 0) != 0
                                       ? true
                                       : false;*/

                var result2 = Memory.ReadUInt32(iUnitAbilitiesPointerResult - 3 + 0xA4 + (i*4));
                /*    BitConverter.ToUInt32(
                        InteropCalls.Help_ReadProcessMemory(HStarcraft, iUnitAbilitiesPointerResult - 3 + 0xA4 + (i * 4), 4), 0);
                */
                var resultOfResult2 = Memory.ReadUInt32(result2 + 4);
                  /*  BitConverter.ToUInt32(
                        InteropCalls.Help_ReadProcessMemory(HStarcraft, (UInt32)(result2 + 4), 4), 0);
                */

                var strAbilityName = Memory.ReadString(resultOfResult2, 16, Encoding.UTF8);
                   /* Encoding.UTF8.GetString(InteropCalls.Help_ReadProcessMemory(HStarcraft, resultOfResult2,
                        16));*/

                var _iArrayOfBytes = Memory.ReadInt32(_iContentOfPointer + 0x34);
                   /* BitConverter.ToInt32(
                        InteropCalls.Help_ReadProcessMemory(HStarcraft, (Int32)_iContentOfPointer + 0x34, 4), 0);
                */

                var _iTempPtr = Memory.ReadInt32(_iArrayOfBytes);
                   /* BitConverter.ToInt32(
                        InteropCalls.Help_ReadProcessMemory(HStarcraft, (Int32)_iArrayOfBytes, 4), 0);
                */

                var _productionChunk = Memory.ReadMemory(_iTempPtr, 0x80);
                   /* InteropCalls.Help_ReadProcessMemory(HStarcraft, _iTempPtr, 0x80);*/

                var _iType = BitConverter.ToInt32(_productionChunk, 0x44);
                var _iSupplyRaw = BitConverter.ToInt32(_productionChunk, 0x64);
                var _iTimeMax = BitConverter.ToUInt32(_productionChunk, 0x68);
                var _iTimeLeft = (float)BitConverter.ToUInt32(_productionChunk, 0x6C);
                var _iMineralCost = BitConverter.ToInt32(_productionChunk, 0x74);
                var _iVespineCost = BitConverter.ToInt32(_productionChunk, 0x78);

                var _iSomething = Memory.ReadInt32(_iContentOfPointer + 0x4);
                   /* BitConverter.ToInt32(
                        InteropCalls.Help_ReadProcessMemory(HStarcraft, (Int32) _iContentOfPointer + 0x4, 4), 0);
                */

                Debug.WriteLine("\n");
                Debug.WriteLine("i: " + i);
                Debug.WriteLine("iPointerResult - 3: 0x" + (iUnitAbilitiesPointerResult - 3).ToString("X8"));
                Debug.WriteLine("Result2 (0xA4): 0x" + result2.ToString("X8"));
                Debug.WriteLine("Result of Result2: 0x" + result2.ToString("X8"));
                Debug.WriteLine("Ability Name: " + strAbilityName);
                //Debug.WriteLine("NumberOfQueuedUnits: " + _iNumberOfQueuedUnits);
                //Debug.WriteLine("Bytebuffer Item: 0x" + byteBuffer[i].ToString("X2") + " - " + byteBuffer[i]);
                //Debug.WriteLine("Minerals: " + _iMineralCost);
                //Debug.WriteLine("Reactor Attached: " + _bReactorAttached);
                //Debug.WriteLine("iType: " + _iType);
                //Debug.WriteLine("Time Left: " + _iTimeLeft);
                //Debug.WriteLine("iContent of pointer: 0x" + _iContentOfPointer.ToString("X8"));
                //Debug.WriteLine("Temp ptr: 0x" + _iTempPtr.ToString("X8"));
                //Debug.WriteLine("iSometzhing: 0x" + _iSomething.ToString("X8"));

                #endregion

            #endif
            }

            /* Read the DATA Pointer (that leads to our result) */
            var iContentOfPointer = Memory.ReadUInt32(iUnitAbilitiesPointer + 0x18 + 4 * iIndexToLookAt);
            /*BitConverter.ToUInt32(
                InteropCalls.Help_ReadProcessMemory(HStarcraft, (Int32)iUnitAbilitiesPointer + 0x18 + 4 * iIndexToLookAt, 4), 0);*/

            /* Number of queued Units */
            var iNumberOfQueuedUnits = Memory.ReadInt32(iContentOfPointer + 0x28);
            /*   BitConverter.ToInt32(
               InteropCalls.Help_ReadProcessMemory(HStarcraft, (Int32) iContentOfPointer + 0x28, 4), 0);*/

            //Check if an addon is beeing added
            var bAddOnAttaching = Memory.ReadInt32(iContentOfPointer + 0x9C) == 260;

            var bReactorAttached = Memory.ReadInt32(iContentOfPointer + 0x48) != 0;
            /*  BitConverter.ToInt32(
              InteropCalls.Help_ReadProcessMemory(HStarcraft, (Int32) iContentOfPointer + 0x48, 4), 0) != 0;*/

            var iArrayOfBytes = Memory.ReadInt32(iContentOfPointer + 0x34);
            /* BitConverter.ToInt32(
                 InteropCalls.Help_ReadProcessMemory(HStarcraft, (Int32) iContentOfPointer + 0x34, 4), 0);*/

            var iTempPtr = Memory.ReadInt32(iArrayOfBytes);
            /*BitConverter.ToInt32(
                InteropCalls.Help_ReadProcessMemory(HStarcraft, iArrayOfBytes , 4), 0);*/

            /* Because it's possible that a Reactor builds two different units, we have to check that! */
            if (bReactorAttached && iNumberOfQueuedUnits > 1)
            {
                var iTempPtr2 = Memory.ReadInt32(iArrayOfBytes + 4);
                /*   BitConverter.ToInt32(
                   InteropCalls.Help_ReadProcessMemory(HStarcraft, iArrayOfBytes + 4, 4), 0);*/

                var productionChunk2 = Memory.ReadMemory(iTempPtr2, 0x80);
                /*InteropCalls.Help_ReadProcessMemory(HStarcraft, iTempPtr2, 0x80);*/

                var iType2 = BitConverter.ToInt32(productionChunk2, 0x44);
                var iSupplyRaw2 = BitConverter.ToInt32(productionChunk2, 0x64);
                var iTimeMax2 = BitConverter.ToUInt32(productionChunk2, 0x68);
                var iTimeLeft2 = (float)BitConverter.ToUInt32(productionChunk2, 0x6C);
                var iMineralCost2 = BitConverter.ToInt32(productionChunk2, 0x74);
                var iVespineCost2 = BitConverter.ToInt32(productionChunk2, 0x78);
                var iUnitIndexBuiltFrom2 = BitConverter.ToUInt16(productionChunk2, 0x5E) / 4;

                Console.WriteLine("Supply Raw: " + iSupplyRaw2);

                var prd2 = new UnitProduction();
                prd2.ProductionStatus = 100 - (iTimeLeft2 / iTimeMax2) * 100;
                prd2.Id = HelpFunctions.GetUnitIdFromLogicalId(structureId, iType2, (Int32)iTimeMax2, iMineralCost2, iVespineCost2, iSupplyRaw2 >> 12);
                prd2.ReactorAttached = bReactorAttached;
                prd2.UnitsInProduction = iNumberOfQueuedUnits;
                prd2.MineralCost = iMineralCost2;
                prd2.AttachingAddOn = bAddOnAttaching;
                prd2.VespineCost = iVespineCost2;
                prd2.SupplyRaw = iSupplyRaw2;
                prd2.Supply = iSupplyRaw2 >> 12;
                prd2.ProductionTimeLeft = iTimeLeft2 / 65536;

                lUnitIds.Add(prd2);
            }

            //That will happen if there is no unit to be build or something is morphing like a Hatch => Lair
            //Thus: Check if the sourcebuilding is a hatch or something..
            else if (iNumberOfQueuedUnits <= 0)
            {
                if (structureId.Equals(UnitId.ZbHatchery) ||
                    structureId.Equals(UnitId.ZbLiar) ||
                    structureId.Equals(UnitId.ZbSpire) ||
                    structureId.Equals(UnitId.ZuBroodlordCocoon) ||
                    structureId.Equals(UnitId.ZuOverseerCocoon) ||
                    structureId.Equals(UnitId.TbCcGround) ||
                    structureId.Equals(UnitId.PuMothershipCore) ||
                    structureId.Equals(UnitId.PuArchon))
                {
                    var iUnitCommandQueuePointer = Memory.ReadUInt32(MyOffsets.UnitStruct + 0xD4 + MyOffsets.UnitStructSize * iUnitNum);
                    /*InteropCalls.ReadUInt32(HStarcraft,
                    MyOffsets.UnitStruct + 0xD4 + MyOffsets.UnitStructSize * iUnitNum);*/

                    if (iUnitCommandQueuePointer > 0)
                    {
                        var iUnitCommandQueueChunk = Memory.ReadMemory(iUnitCommandQueuePointer + 0x98, 0xCC);
                        /*InteropCalls.Help_ReadProcessMemory(HStarcraft,
                            iUnitCommandQueuePointer + 0x98,
                            0xCC);
                        */
                        var iType2 = -1; //BitConverter.ToInt32(iUnitCommandQueueChunk, 0x44);
                        var iTimeMax2 = BitConverter.ToUInt32(iUnitCommandQueueChunk, 0x1C);
                        var iTimeLeft2 = (float)BitConverter.ToUInt32(iUnitCommandQueueChunk, 0);
                        var iMineralCost2 = BitConverter.ToInt32(iUnitCommandQueueChunk, 0xC4);
                        var iVespineCost2 = BitConverter.ToInt32(iUnitCommandQueueChunk, 0xC8);

                        var prd2 = new UnitProduction
                        {
                            Id =
                                HelpFunctions.GetUnitIdFromLogicalId(structureId, iType2, (Int32)iTimeMax2,
                                    iMineralCost2, iVespineCost2, 0),
                            MineralCost = iMineralCost2,
                            ProductionStatus = 100 - (iTimeLeft2 / iTimeMax2) * 100,
                            ProductionTimeLeft = iTimeLeft2 / 65536,
                            ReactorAttached = false,
                            Supply = 0,
                            SupplyRaw = 0,
                            UnitsInProduction = 0,
                            VespineCost = iVespineCost2
                        };

                        lUnitIds.Add(prd2);

                    }
                }
            }

            var productionChunk = Memory.ReadMemory(iTempPtr, 0x80);// InteropCalls.Help_ReadProcessMemory(HStarcraft, iTempPtr, 0x80);

            #region Debug and Tests

            // /* Read all 4- Bytes */

            // //var sw = new StreamWriter("Seeking.txt");
            // var strResult = "Looking for (Marine): 85 - (0x55)\n\n";

            // //sw.WriteLine(strResult);
            // for (var i = 0; i < productionChunk.Length / 4; i++)
            // {
            //     //strResult = String.Empty;

            //     //strResult += "0x" + (i * 4).ToString("X2");
            //     //strResult += ":";
            //     //strResult += (BitConverter.ToInt32(productionChunk, i * 4)).ToString() + " - (0x" +
            //     //             (BitConverter.ToInt32(productionChunk, i * 4)).ToString("X2") + ")";

            //     //sw.WriteLine(strResult);
            //     var iProbPtr = BitConverter.ToInt32(productionChunk, i * 4);
            //     var iResPtr = InteropCalls.Help_ReadProcessMemory(HStarcraft, iProbPtr, 4);

            //     var iInt32ResPtr = BitConverter.ToInt32(iResPtr, 0);

            //     //if (iInt32ResPtr != 0)
            //     //{
            //     //    var iChunk = InteropCalls.Help_ReadProcessMemory(HStarcraft, iInt32ResPtr, 0x80);

            //     //    strResult += "We are at: 0x" + iInt32ResPtr.ToString("X2") + "\n";

            //     //    for (var j = 0; j < 0x80/2; j++)
            //     //    {
            //     //        strResult += "0x" + (j*2).ToString("X2") + ": " + (BitConverter.ToUInt16(iChunk, j*2) / 4096).ToString() +
            //     //                     " - (0x" +
            //     //                     (BitConverter.ToUInt16(iChunk, j*2) / 4096).ToString("X2") + ")";
            //     //        strResult += "\n";

            //     //    }

            //     if (iInt32ResPtr != 0)
            //     {
            //         strResult += "0x" + (i * 4).ToString("X2");
            //         strResult += ":";
            //         strResult += ((BitConverter.ToInt32(productionChunk, i * 4) << 5) & 0xFFFFFFFC).ToString() + " - (0x" +
            //                      ((BitConverter.ToInt32(productionChunk, i * 4) << 5) & 0xFFFFFFFC).ToString("X2") + ")";
            //         strResult += "\n";
            //     }

            //     //}
            // }
            // MessageBox.Show(strResult);

            //// sw.Close();

            // //MessageBox.Show(strResult);

            #endregion

            var iType = BitConverter.ToInt32(productionChunk, 0x44);
            var iSupplyRaw = BitConverter.ToInt32(productionChunk, 0x64);
            var iTimeMax = BitConverter.ToUInt32(productionChunk, 0x68);
            var iTimeLeft = (float)BitConverter.ToUInt32(productionChunk, 0x6C);
            var iMineralCost = BitConverter.ToInt32(productionChunk, 0x74);
            var iVespineCost = BitConverter.ToInt32(productionChunk, 0x78);
            var iUnitIndexBuiltFrom = BitConverter.ToUInt16(productionChunk, 0x5E) / 4;
            var strType = Convert.ToString(iType, 16);

            var prd = new UnitProduction();
            prd.ProductionStatus = 100 - (iTimeLeft / iTimeMax) * 100;
            prd.Id = HelpFunctions.GetUnitIdFromLogicalId(structureId, iType, (Int32)iTimeMax, iMineralCost, iVespineCost, iSupplyRaw >> 12);
            prd.ReactorAttached = bReactorAttached;
            prd.UnitsInProduction = iNumberOfQueuedUnits;
            prd.MineralCost = iMineralCost;
            prd.VespineCost = iVespineCost;
            prd.SupplyRaw = iSupplyRaw;
            prd.Supply = iSupplyRaw >> 12;
            prd.ProductionTimeLeft = iTimeLeft / 65536;
            prd.AttachingAddOn = bAddOnAttaching;

            if (prd.Id != UnitId.None)
                lUnitIds.Add(prd);

            return lUnitIds;
        }
Ejemplo n.º 39
0
 private void RemoveUnitFromSettings(UnitId unitId)
 {
     if (PSettings.PreferenceAll.OverlayAlert.UnitIds.Contains(unitId))
         PSettings.PreferenceAll.OverlayAlert.UnitIds.Remove(unitId);
 }
Ejemplo n.º 40
0
        private void AddUnit(UnitId unitId)
        {
            if (LUnitFilter.ContainsKey(unitId))
            {
                new AnotherMessageBox().Show(_lstrMaphackFilterMessageAddUnitText.ToString(), _lstrMaphackFilterMessageAddUnitHeader.ToString());

                var items = lstvMaphackBasicsUnitFilter.Items.Find(unitId.ToString(), false);

                if (items.Length <= 0)
                    return;

                foreach (ListViewItem item in lstvMaphackBasicsUnitFilter.Items)
                {
                    item.Selected = false;
                }

                items[0].Selected = true;

                return;
            }

            var cl = new Color().GetRandomColor();
            LUnitFilter.Add(unitId, cl);

            AddUnitsToListview();
            AddUnitToSettings(unitId, cl);
        }
Ejemplo n.º 41
0
        /* As the actual max- health of units is lost, I map them manually.. */
        public static Int32 GetMaximumHealth(UnitId id)
        {
            switch (id)
            {
                case UnitId.PbAssimilator:
                    return 450;

                case UnitId.PbCannon:
                    return 150;

                case UnitId.PbCybercore:
                    return 550;

                case UnitId.PbDarkshrine:
                    return 500;

                case UnitId.PbFleetbeacon:
                    return 500;

                case UnitId.PbForge:
                    return 400;

                case UnitId.PbGateway:
                    return 500;

                case UnitId.PbNexus:
                    return 1000;

                case UnitId.PbPylon:
                    return 200;

                case UnitId.PbRoboticsbay:
                    return 450;

                case UnitId.PbRoboticssupportbay:
                    return 500;

                case UnitId.PbStargate:
                    return 600;

                case UnitId.PbTemplararchives:
                    return 500;

                case UnitId.PbTwilightcouncil:
                    return 500;

                case UnitId.PbWarpgate:
                    return 500;

                case UnitId.TbArmory:
                    return 750;

                case UnitId.TbAutoTurret:
                    return 150;

                case UnitId.TbBarracksGround:
                    return 1000;

                case UnitId.TbBunker:
                    return 400;

                case UnitId.TbCcAir:
                    return 1500;

                case UnitId.TbCcGround:
                    return 1500;

                case UnitId.TbEbay:
                    return 850;

                case UnitId.TbFactoryAir:
                    return 1250;

                case UnitId.TbFactoryGround:
                    return 1250;

                case UnitId.TbFusioncore:
                    return 750;

                case UnitId.TbGhostacademy:
                    return 1250;

                case UnitId.TbOrbitalAir:
                    return 1500;

                case UnitId.TbOrbitalGround:
                    return 1500;

                case UnitId.TbPlanetary:
                    return 1500;

                case UnitId.TbRaxAir:
                    return 1000;

                case UnitId.TbReactor:
                    return 400;

                case UnitId.TbReactorFactory:
                    return 400;

                case UnitId.TbReactorRax:
                    return 400;

                case UnitId.TbReactorStarport:
                    return 400;

                case UnitId.TbRefinery:
                    return 500;

                case UnitId.TbSensortower:
                    return 200;

                case UnitId.TbStarportAir:
                    return 1300;

                case UnitId.TbStarportGround:
                    return 1300;

                case UnitId.TbSupplyGround:
                    return 400;

                case UnitId.TbSupplyHidden:
                    return 400;

                case UnitId.TbTechlab:
                    return 400;

                case UnitId.TbTechlabFactory:
                    return 400;

                case UnitId.TbTechlabRax:
                    return 400;

                case UnitId.TbTechlabStarport:
                    return 400;

                case UnitId.TbTurret:
                    return 250;

                case UnitId.ZbBanelingNest:
                    return 850;

                case UnitId.ZbCreeptumor:
                    return 50;

                case UnitId.ZbCreepTumorBuilding:
                    return 50;

                case UnitId.ZbCreepTumorMissle:
                    return 50;

                case UnitId.ZbCreeptumorBurrowed:
                    return 50;

                case UnitId.ZbEvolutionChamber:
                    return 750;

                case UnitId.ZbExtractor:
                    return 500;

                case UnitId.ZbGreaterspire:
                    return 1000;

                case UnitId.ZbHatchery:
                    return 1500;

                case UnitId.ZbHive:
                    return 2500;

                case UnitId.ZbHydraDen:
                    return 850;

                case UnitId.ZbInfestationPit:
                    return 850;

                case UnitId.ZbLiar:
                    return 2000;

                case UnitId.ZbNydusNetwork:
                    return 850;

                case UnitId.ZbNydusWorm:
                    return 200;

                case UnitId.ZbRoachWarren:
                    return 850;

                case UnitId.ZbSpawningPool:
                    return 1000;

                case UnitId.ZbSpineCrawler:
                    return 300;

                case UnitId.ZbSpire:
                    return 850;

                case UnitId.ZbSporeCrawler:
                    return 400;

                case UnitId.ZbUltraCavern:
                    return 850;

                default:
                    return 0;
            }
        }
Ejemplo n.º 42
0
        private void AddNewUnit(PlayerStore playerStore, UnitId unitId)
        {
            try
            {
                var time = playerStore.Units[unitId].InitDate;

                if ((DateTime.Now - time).Seconds > PSettings.PreferenceAll.OverlayAlert.Time)
                    playerStore.Units[unitId] = new UnitListData(time, false, true);
            }
            catch (KeyNotFoundException)
            {
                playerStore.Units.Add(unitId, new UnitListData(DateTime.Now, true, false));
            }
        }
Ejemplo n.º 43
0
        public static UnitId GetUnitIdFromLogicalId(UnitId structureBuildFrom, Int32 logicalId, Int32 maximumTime, Int32 mineralCost, Int32 vespineCost, int supply)
        {
            if (logicalId.Equals(0))
                return UnitId.NbXelNagaTower;

            if (!logicalId.Equals(-1))
            {

                var strStuff = Convert.ToString(logicalId, 16);
                strStuff = "1" + strStuff.Substring(1);

                var inumber = int.Parse(strStuff, NumberStyles.HexNumber);

                logicalId = inumber;
            }

            #region Terran

            #region CC - Orbital - PF

            if (structureBuildFrom.Equals(UnitId.TbCcGround))
            {
                //E.G. Upgrade to Lair/ Hive
                if (logicalId == -1)
                {
                    if (mineralCost == 150 && vespineCost == 0)
                        return UnitId.TupUpgradeToOrbital;

                    if (mineralCost == 150 && vespineCost == 150)
                        return UnitId.TupUpgradeToPlanetary;
                }

                return UnitId.TuScv;
            }

            if (structureBuildFrom.Equals(UnitId.TbPlanetary))
                return UnitId.TuScv;

            if (structureBuildFrom.Equals(UnitId.TbOrbitalGround))
                return UnitId.TuScv;

            #endregion

            #region Barracks

            if (structureBuildFrom.Equals(UnitId.TbBarracksGround))
            {
                /* Database for the units from the Barracks
                 * Unit         |   Time    |   Min |   Ves |   Sup
                 * -------------|-----------|-------|-------|-------
                 * Marine       |1638400    |   50  |   0   |   1
                 * Reaper       |2949120    |   50  |   50  |   1
                 * Marauder     |1966080    |   100 |   25  |   2
                 * Ghost        |2621440    |   200 |   100 |   2
                 * */

                switch (maximumTime)
                {
                    case 1638400:
                        return UnitId.TuMarine;

                    case 2949120:
                        return UnitId.TuReaper;

                    case 2621440:
                        return UnitId.TuGhost;

                    case 1966080:
                        return UnitId.TuMarauder;
                }
            }

            #endregion

            #region Factory

            else if (structureBuildFrom.Equals(UnitId.TbFactoryGround))
            {
                /* Database for the units from the Barracks
                * Unit         |   Time    |   Min |   Ves |   Sup
                * -------------|-----------|-------|-------|-------
                * Hellion      |1966080    |   100 |   0   |   2
                * Hellbat      |1966080    |   100 |   0   |   2
                * Mine         |2621440    |   75  |   25  |   2
                * Siege Tank   |2949120    |   150 |   125 |   3
                * Thor         |3932160    |   300 |   200 |   6
                * */

                if (logicalId.Equals(65541))
                    return UnitId.TuHellion;

                if (logicalId.Equals(65542))
                    return UnitId.TuHellbat;

                switch (maximumTime)
                {
                    case 3932160:
                        return UnitId.TuThor;

                    case 2621440:
                        return UnitId.TuWidowMine;

                    case 2949120:
                        return UnitId.TuSiegetank;
                }
            }

            #endregion

            #region Starport

            else if (structureBuildFrom.Equals(UnitId.TbStarportGround))
            {
                /* Database for the units from the Barracks
                * Unit         |   Time    |   Min |   Ves |   Sup
                * -------------|-----------|-------|-------|-------
                * Viking       |2752512    |   150 |   75  |   2
                * Medivac      |2752512    |   100 |   100 |   2
                * Raven        |3932160    |   100 |   200 |   2
                * Banshee      |3932160    |   150 |   100 |   3
                * Battlecruiser|5898240    |   400 |   300 |   6
                * */

                if (mineralCost.Equals(150) &&
                    vespineCost.Equals(75))
                    return UnitId.TuVikingAir;

                if (mineralCost.Equals(100) &&
                    vespineCost.Equals(100))
                    return UnitId.TuMedivac;

                if (mineralCost.Equals(100) &&
                    vespineCost.Equals(200))
                    return UnitId.TuRaven;

                if (mineralCost.Equals(150) &&
                    vespineCost.Equals(100))
                    return UnitId.TuBanshee;

                if (mineralCost.Equals(400) &&
                    vespineCost.Equals(300))
                    return UnitId.TuBattlecruiser;
            }

            #endregion

            /* - Upgrades - */

            #region Engineering Bay

            if (structureBuildFrom.Equals(UnitId.TbEbay))
            {
                if (logicalId.Equals(0x10002))
                    return UnitId.TupInfantryWeapon1;

                if (logicalId.Equals(0x10003))
                    return UnitId.TupInfantryWeapon2;

                if (logicalId.Equals(0x10004))
                    return UnitId.TupInfantryWeapon3;

                if (logicalId.Equals(0x10006))
                    return UnitId.TupInfantryArmor1;

                if (logicalId.Equals(0x10007))
                    return UnitId.TupInfantryArmor2;

                if (logicalId.Equals(0x10008))
                    return UnitId.TupInfantryArmor3;

                if (mineralCost.Equals(100) &&
                    vespineCost.Equals(100) &&
                    maximumTime.Equals(5242880))
                    return UnitId.TupHighSecAutoTracking;

                if (mineralCost.Equals(100) &&
                    vespineCost.Equals(100) &&
                    maximumTime.Equals(7208960))
                    return UnitId.TupNeosteelFrame;

                if (mineralCost.Equals(150) &&
                    vespineCost.Equals(150) &&
                    maximumTime.Equals(9175040))
                    return UnitId.TupStructureArmor;
            }

            #endregion

            #region GhostAcademy

            else if (structureBuildFrom.Equals(UnitId.TbGhostacademy))
            {
                if (mineralCost.Equals(150))
                    return UnitId.TupPersonalCloak;

                if (mineralCost.Equals(100))
                {
                    if (logicalId.Equals(0x10000))
                        return UnitId.TuNuke;

                    return UnitId.TupMoebiusReactor;
                }

            }

            #endregion

            #region FusionCore

            else if (structureBuildFrom.Equals(UnitId.TbFusioncore))
            {
                if (maximumTime.Equals(3932160))
                    return UnitId.TupWeaponRefit;

                if (maximumTime.Equals(5242880))
                    return UnitId.TupBehemothReactor;
            }

            #endregion

            #region Armory

            else if (structureBuildFrom.Equals(UnitId.TbArmory))
            {
                if (mineralCost.Equals(100) &&
                    vespineCost.Equals(100) &&
                    maximumTime.Equals(10485760) &&
                    logicalId.Equals(65536))
                    return UnitId.TupVehicleWeapon1;

                if (mineralCost.Equals(175) &&
                    vespineCost.Equals(175) &&
                    maximumTime.Equals(12451840) &&
                    logicalId.Equals(65537))
                    return UnitId.TupVehicleWeapon2;

                if (mineralCost.Equals(250) &&
                    vespineCost.Equals(250) &&
                    maximumTime.Equals(14417920) &&
                    logicalId.Equals(65538))
                    return UnitId.TupVehicleWeapon3;

                if (mineralCost.Equals(100) &&
                    vespineCost.Equals(100) &&
                    maximumTime.Equals(10485760) &&
                    logicalId.Equals(65547))
                    return UnitId.TupShipWeapon1;

                if (mineralCost.Equals(175) &&
                    vespineCost.Equals(175) &&
                    maximumTime.Equals(12451840) &&
                    logicalId.Equals(65548))
                    return UnitId.TupShipWeapon2;

                if (mineralCost.Equals(250) &&
                    vespineCost.Equals(250) &&
                    maximumTime.Equals(14417920) &&
                    logicalId.Equals(65549))
                    return UnitId.TupShipWeapon3;

                if (mineralCost.Equals(100) &&
                    vespineCost.Equals(100) &&
                    maximumTime.Equals(10485760) &&
                    logicalId.Equals(65539))
                    return UnitId.TupVehicleShipPlanting1;

                if (mineralCost.Equals(175) &&
                    vespineCost.Equals(175) &&
                    maximumTime.Equals(12451840) &&
                    logicalId.Equals(65540))
                    return UnitId.TupVehicleShipPlanting2;

                if (mineralCost.Equals(250) &&
                    vespineCost.Equals(250) &&
                    maximumTime.Equals(14417920) &&
                    logicalId.Equals(65541))
                    return UnitId.TupVehicleShipPlanting3;
            }

            #endregion

            #region Techlab Barracks

            else if (structureBuildFrom.Equals(UnitId.TbTechlabRax))
            {
                if (maximumTime.Equals(11141120))
                    return UnitId.TupStim;

                if (maximumTime.Equals(7208960))
                    return UnitId.TupCombatShields;

                if (maximumTime.Equals(3932160))
                    return UnitId.TupConcussiveShells;
            }

            #endregion

            #region Techlab Factory

            else if (structureBuildFrom.Equals(UnitId.TbTechlabFactory))
            {
                if (logicalId.Equals(65537))
                    return UnitId.TupBlueFlame;

                if (logicalId.Equals(65539))
                    return UnitId.TupTransformatorServos;

                if (logicalId.Equals(65540))
                    return UnitId.TupDrillingClaws;
            }

            #endregion

            #region Techlab Starport

            else if (structureBuildFrom.Equals(UnitId.TbTechlabStarport))
            {
                if (logicalId.Equals(65536))
                    return UnitId.TupCloakingField;

                if (logicalId.Equals(65539))
                    return UnitId.TupCorvidReactor;

                if (logicalId.Equals(65543))
                    return UnitId.TupDurableMeterials;

                if (logicalId.Equals(65538))
                    return UnitId.TupCaduceusReactor;
            }

            #endregion

            #endregion

            #region Protoss

            if (structureBuildFrom.Equals(UnitId.PuMothershipCore))
            {
                //E.G. Upgrade to Lair/ Hive
                if (logicalId == -1)
                {
                    if (mineralCost == 300 && vespineCost == 300)
                        return UnitId.PupUpgradeToMothership;
                }
            }

            #region Units

            #region Nexus

            if (structureBuildFrom.Equals(UnitId.PbNexus))
            {
                switch (maximumTime)
                {
                    case 1114112:
                        return UnitId.PuProbe;

                    case 1966080:
                        return UnitId.PuMothershipCore;
                }
            }

            #endregion

            #region Gateway

            if (structureBuildFrom.Equals(UnitId.PbGateway))
            {
                /* Database for the units from the Gateway
                * Unit         |   Time    |   Min |   Ves |   Sup
                * -------------|-----------|-------|-------|-------
                * Zealot       |2490368    |   100 |   0   |   2
                * Stalker      |2752512    |   125 |   50  |   2
                * Sentry       |2424832    |   50  |   100 |   2
                * HT           |3604480    |   50  |   150 |   2
                * DT           |3604480    |   125 |   125 |   2
                * */
                if (mineralCost.Equals(100))
                    return UnitId.PuZealot;

                if (mineralCost.Equals(125) &&
                    vespineCost.Equals(50))
                    return UnitId.PuStalker;

                if (mineralCost.Equals(50) &&
                    vespineCost.Equals(100))
                    return UnitId.PuSentry;

                if (mineralCost.Equals(50) &&
                    vespineCost.Equals(150))
                    return UnitId.PuHightemplar;

                if (mineralCost.Equals(125) &&
                    vespineCost.Equals(125))
                    return UnitId.PuDarktemplar;
            }

            #endregion

            #region Stargate

            else if (structureBuildFrom.Equals(UnitId.PbStargate))
            {
                /* Database for the units from the Gateway
                * Unit         |   Time    |   Min |   Ves |   Sup
                * -------------|-----------|-------|-------|-------
                * Phoenix      |2293760    |   150 |   100 |   2
                * Oracle       |3276800    |   150 |   150 |   3
                * Void Ray     |3932160    |   250 |   150 |   4
                * Tempest      |3932160    |   300 |   200 |   4
                * Carrier      |7864320    |   350 |   250 |   6
                * */

                if (mineralCost.Equals(150) &&
                    vespineCost.Equals(100))
                    return UnitId.PuPhoenix;

                if (mineralCost.Equals(150) &&
                    vespineCost.Equals(150))
                    return UnitId.PuOracle;

                if (mineralCost.Equals(250) &&
                    vespineCost.Equals(150))
                    return UnitId.PuVoidray;

                if (mineralCost.Equals(300) &&
                    vespineCost.Equals(200))
                    return UnitId.PuTempest;

                if (mineralCost.Equals(350) &&
                    vespineCost.Equals(250))
                    return UnitId.PuCarrier;
            }

            #endregion

            #region Robotics

            if (structureBuildFrom.Equals(UnitId.PbRoboticsbay))
            {
                /* Database for the units from the Gateway
                * Unit         |   Time    |   Min |   Ves |   Sup
                * -------------|-----------|-------|-------|-------
                * Observer     |1966080    |   25  |   75  |   1
                * Warp Prism   |3276800    |   200 |   0   |   2
                * Colossus     |4915200    |   300 |   200 |   6
                * Immortal     |3604480    |   250 |   100 |   4
                * */

                if (mineralCost.Equals(25))
                    return UnitId.PuObserver;

                if (mineralCost.Equals(200))
                    return UnitId.PuWarpprismTransport;

                if (mineralCost.Equals(300))
                    return UnitId.PuColossus;

                if (mineralCost.Equals(250))
                    return UnitId.PuImmortal;
            }

            #endregion

            #endregion

            #region Upgrades

            #region Forge

            if (structureBuildFrom.Equals(UnitId.PbForge))
            {
                if (logicalId.Equals(0x10000))
                    return UnitId.PupGroundW1;

                if (logicalId.Equals(0x10001))
                    return UnitId.PupGroundW2;

                if (logicalId.Equals(0x10002))
                    return UnitId.PupGroundW3;

                if (logicalId.Equals(0x10003))
                    return UnitId.PupGroundA1;

                if (logicalId.Equals(0x10004))
                    return UnitId.PupGroundA2;

                if (logicalId.Equals(0x10005))
                    return UnitId.PupGroundA3;

                if (logicalId.Equals(0x10006))
                    return UnitId.PupS1;

                if (logicalId.Equals(0x10007))
                    return UnitId.PupS2;

                if (logicalId.Equals(0x10008))
                    return UnitId.PupS3;
            }

            #endregion

            #region CyberCore

            if (structureBuildFrom.Equals(UnitId.PbCybercore))
            {
                if (logicalId.Equals(0x10000))
                    return UnitId.PupAirW1;

                if (logicalId.Equals(0x10001))
                    return UnitId.PupAirW2;

                if (logicalId.Equals(0x10002))
                    return UnitId.PupAirW3;

                if (logicalId.Equals(0x10003))
                    return UnitId.PupAirA1;

                if (logicalId.Equals(0x10004))
                    return UnitId.PupAirA2;

                if (logicalId.Equals(0x10005))
                    return UnitId.PupAirA3;

                if (logicalId.Equals(0x10006))
                    return UnitId.PupWarpGate;
            }

            #endregion

            #region Robotics Support Bay

            if (structureBuildFrom.Equals(UnitId.PbRoboticssupportbay))
            {
                if (logicalId.Equals(0x10001))
                    return UnitId.PupGraviticBooster;

                if (logicalId.Equals(0x10002))
                    return UnitId.PupGraviticDrive;

                if (logicalId.Equals(0x10005))
                    return UnitId.PupExtendedThermalLance;
            }

            #endregion

            #region Twilight Council

            if (structureBuildFrom.Equals(UnitId.PbTwilightcouncil))
            {
                if (logicalId.Equals(0x10000))
                    return UnitId.PupCharge;

                if (logicalId.Equals(0x10001))
                    return UnitId.PupBlink;
            }

            #endregion

            #region Fleet Beacon

            if (structureBuildFrom.Equals(UnitId.PbFleetbeacon))
            {
                if (logicalId.Equals(0x10000))
                    return UnitId.PupGravitonCatapult;

                if (logicalId.Equals(0x10002))
                    return UnitId.PupAnionPulseCrystals;
            }

            #endregion

            #region Templar Archives

            if (structureBuildFrom.Equals(UnitId.PbTemplararchives))
            {
                if (logicalId.Equals(0x10004))
                    return UnitId.PupStorm;
            }

            #endregion

            #endregion

            #endregion

            #region Zerg

            if (structureBuildFrom.Equals(UnitId.ZbHatchery) ||
                structureBuildFrom.Equals(UnitId.ZbLiar) ||
                structureBuildFrom.Equals(UnitId.ZbHive))
            {
                if (logicalId.Equals(0x10001))
                    return UnitId.ZupPneumatizedCarapace;

                if (logicalId.Equals(0x10002))
                    return UnitId.ZupVentralSacs;

                if (logicalId.Equals(0x10003))
                    return UnitId.ZupBurrow;

                //E.G. Upgrade to Lair/ Hive
                if (logicalId == -1)
                {
                    if (mineralCost == 150 && vespineCost == 100)
                        return UnitId.ZupUpgradeToLair;

                    if (mineralCost == 200 && vespineCost == 150)
                        return UnitId.ZupUpgradeToHive;
                }

                return UnitId.ZuQueen;
            }

            if (structureBuildFrom.Equals(UnitId.ZbSpire))
            {
                //E.G. Upgrade to Lair/ Hive
                if (logicalId == -1)
                {
                    if (mineralCost == 100 && vespineCost == 150)
                        return UnitId.ZupUpgradeToGreaterSpire;
                }
            }

            #region Units

            if (structureBuildFrom.Equals(UnitId.ZuBanelingCocoon))
            {
                if (maximumTime.Equals(1310720))
                    return UnitId.ZuBaneling;
            }

            if (structureBuildFrom.Equals(UnitId.ZuBroodlordCocoon))
            {
                //E.G. Upgrade to Lair/ Hive
                if (logicalId == -1)
                {
                    if (mineralCost == 150 && vespineCost == 150)
                        return UnitId.ZupUpgradeToBroodlord;
                }
            }

            if (structureBuildFrom.Equals(UnitId.ZuOverseerCocoon))
            {
                //E.G. Upgrade to Lair/ Hive
                if (logicalId == -1)
                {
                    if (mineralCost == 50 && vespineCost == 50)
                        return UnitId.ZupUpgradeToOverseer;
                }
            }

            /* For the eggs, we have to cchack using other values..
             Player 2 has the Type waay different. */
            if (structureBuildFrom.Equals(UnitId.ZuEgg))
            {
                /* Database for the units from the egg
                 * Unit         |   Time    |   Min |   Ves |   Sup
                 * -------------|-----------|-------|-------|-------
                 * Drone        |1114112    |   50  |   0   |   1
                 * Zergling     |1572864    |   50  |   0   |   1
                 * Overlord     |1638400    |   100 |   0   |   -
                 * Roach        |1769472    |   75  |   25  |   2
                 * Hydralisk    |2162688    |   100 |   50  |   2
                 * Mutalsik     |2162688    |   100 |   100 |   2
                 * Corruptor    |2621440    |   150 |   100 |   3
                 * Infestor     |3276800    |   100 |   150 |   2
                 * Swarm Host   |2621440    |   200 |   100 |   3
                 * Viper        |2621440    |   100 |   200 |   3
                 * Ultralisk    |3604480    |   300 |   200 |   6
                 * */

                if (maximumTime.Equals(1114112))
                    return UnitId.ZuDrone;

                if (maximumTime.Equals(1572864))
                    return UnitId.ZuZergling;

                if (maximumTime.Equals(1638400))
                    return UnitId.ZuOverlord;

                if (maximumTime.Equals(1769472))
                    return UnitId.ZuRoach;

                if (maximumTime.Equals(2162688))
                {
                    if (vespineCost.Equals(50))
                        return UnitId.ZuHydralisk;

                    return UnitId.ZuMutalisk;
                }

                if (maximumTime.Equals(2621440))
                {
                    if (mineralCost.Equals(150))
                        return UnitId.ZuCorruptor;

                    if (mineralCost.Equals(100) &&
                        vespineCost == 200 &&
                        supply == 4)
                        return UnitId.ZuSwarmHost;

                    if (mineralCost.Equals(100) &&
                        vespineCost == 200 &&
                        supply == 3)
                        return UnitId.ZuViper;
                }

                if (maximumTime.Equals(3276800))
                    return UnitId.ZuInfestor;

                if (maximumTime.Equals(3604480))
                    return UnitId.ZuUltra;

            }

            #endregion

            #region Upgrades

            #region Evolution Chamber

            if (structureBuildFrom.Equals(UnitId.ZbEvolutionChamber))
            {
                if (logicalId.Equals(0x10000))
                    return UnitId.ZupGroundM1;

                if (logicalId.Equals(0x10001))
                    return UnitId.ZupGroundM2;

                if (logicalId.Equals(0x10002))
                    return UnitId.ZupGroundM3;

                if (logicalId.Equals(0x10003))
                    return UnitId.ZupGroundA1;

                if (logicalId.Equals(0x10004))
                    return UnitId.ZupGroundA2;

                if (logicalId.Equals(0x10005))
                    return UnitId.ZupGroundA3;

                if (logicalId.Equals(0x10006))
                    return UnitId.ZupGroundW1;

                if (logicalId.Equals(0x10007))
                    return UnitId.ZupGroundW2;

                if (logicalId.Equals(0x10008))
                    return UnitId.ZupGroundW3;
            }

            #endregion

            #region Spire/ Greater Spire

            if (structureBuildFrom.Equals(UnitId.ZbSpire) ||
                structureBuildFrom.Equals(UnitId.ZbGreaterspire))
            {
                if (logicalId.Equals(0x10000))
                    return UnitId.ZupAirW1;

                if (logicalId.Equals(0x10001))
                    return UnitId.ZupAirW2;

                if (logicalId.Equals(0x10002))
                    return UnitId.ZupAirW3;

                if (logicalId.Equals(0x10003))
                    return UnitId.ZupAirA1;

                if (logicalId.Equals(0x10004))
                    return UnitId.ZupAirA2;

                if (logicalId.Equals(0x10005))
                    return UnitId.ZupAirA3;
            }

            #endregion

            #region Hydra Den

            if (structureBuildFrom.Equals(UnitId.ZbHydraDen))
            {
                if (logicalId.Equals(0x10002))
                    return UnitId.ZupGroovedSpines;

                if (logicalId.Equals(0x10003))
                    return UnitId.ZupMuscularAugments;
            }

            #endregion

            #region Roach Warran

            if (structureBuildFrom.Equals(UnitId.ZbRoachWarren))
            {
                if (logicalId.Equals(0x10001))
                    return UnitId.ZupGlialReconstruction;

                if (logicalId.Equals(0x10002))
                    return UnitId.ZupTunnelingClaws;
            }

            #endregion

            #region Infestation Pit

            if (structureBuildFrom.Equals(UnitId.ZbInfestationPit))
            {
                if (logicalId.Equals(0x10002))
                    return UnitId.ZupPathoglenGlands;

                if (logicalId.Equals(0x10003))
                    return UnitId.ZupNeutralParasite;

                if (logicalId.Equals(0x10004))
                    return UnitId.ZupEnduringLocusts;

                if (logicalId.Equals(0x10005))
                    return UnitId.ZupFlyingLocust;
            }

            #endregion

            #region Spawning Pool

            if (structureBuildFrom.Equals(UnitId.ZbSpawningPool))
            {
                if (logicalId.Equals(0x10000))
                    return UnitId.ZupAdrenalGlands;

                if (logicalId.Equals(0x10001))
                    return UnitId.ZupMetabolicBoost;
            }

            #endregion

            #region Baneling Nest

            if (structureBuildFrom.Equals(UnitId.ZbBanelingNest))
            {
                if (logicalId.Equals(0x10000))
                    return UnitId.ZupCentrifugalHooks;
            }

            #endregion

            #region Ultra Cavern

            if (structureBuildFrom.Equals(UnitId.ZbUltraCavern))
            {
                if (logicalId.Equals(0x10002))
                    return UnitId.ZupChitinousPlating;
            }

            #endregion

            #endregion

            /* Missing: Broodlord Cocoon and Overseer Cocoon - Cant be found.. */
            #endregion

            return UnitId.None;
        }