Beispiel #1
0
        public StandardisedItem BuildItem(EntityClassDefinition entity)
        {
            var stdItem = new StandardisedItem
            {
                ClassName    = entity.ClassName,
                Size         = entity.Components.SAttachableComponentParams?.AttachDef.Size ?? 0,
                Grade        = entity.Components.SAttachableComponentParams?.AttachDef.Grade ?? 0,
                Type         = BuildTypeName(entity.Components.SAttachableComponentParams?.AttachDef.Type, entity.Components.SAttachableComponentParams?.AttachDef.SubType),
                Name         = localisationSvc.GetText(entity.Components.SAttachableComponentParams?.AttachDef.Localization.Name, entity.ClassName),
                Description  = localisationSvc.GetText(entity.Components.SAttachableComponentParams?.AttachDef.Localization.Description),
                Manufacturer = manufacturerSvc.GetManufacturer(entity.Components.SAttachableComponentParams?.AttachDef.Manufacturer, entity.ClassName),
                Ports        = BuildPortList(entity),
                Tags         = BuildTagList(entity)
            };

            stdItem.Shield             = BuildShieldInfo(entity);
            stdItem.QuantumDrive       = BuildQuantumDriveInfo(entity);
            stdItem.PowerPlant         = BuildPowerPlantInfo(entity);
            stdItem.Cooler             = BuildCoolerInfo(entity);
            stdItem.Durability         = BuildDurabilityInfo(entity);
            stdItem.Thruster           = BuildThrusterInfo(entity);
            stdItem.CargoGrid          = BuildCargoGridInfo(entity);
            stdItem.QuantumFuelTank    = BuildQuantumFuelTankInfo(entity);
            stdItem.HydrogenFuelTank   = BuildHydrogenFuelTankInfo(entity);
            stdItem.HydrogenFuelIntake = BuildHydrogenFuelIntakeInfo(entity);
            stdItem.Armour             = BuildArmourInfo(entity);
            stdItem.Emp                 = BuildEmpInfo(entity);
            stdItem.MissileRack         = BuildMissileRackInfo(entity);
            stdItem.QuantumInterdiction = BuildQigInfo(entity);
            stdItem.Ifcs                = BuildIfcsInfo(entity);
            stdItem.HeatConnection      = BuildHeatConnectionInfo(entity);
            stdItem.PowerConnection     = BuildPowerConnectionInfo(entity);
            stdItem.Weapon              = BuildWeaponInfo(entity);
            stdItem.Ammunition          = BuildAmmunitionInfo(entity);
            stdItem.Missile             = BuildMissileInfo(entity);
            stdItem.Scanner             = BuildScannerInfo(entity);
            stdItem.Radar               = BuildRadarInfo(entity);
            stdItem.Ping                = BuildPingInfo(entity);
            stdItem.WeaponRegenPool     = BuildWeaponRegenInfo(entity);

            return(stdItem);
        }
Beispiel #2
0
        ItemIndexEntry CreateIndexEntry(EntityClassDefinition entity)
        {
            var classification = itemClassifier.Classify(entity);

            var indexEntry = new ItemIndexEntry
            {
                className      = entity.ClassName,
                reference      = entity.__ref,
                itemName       = entity.ClassName.ToLower(),
                type           = entity.Components?.SAttachableComponentParams?.AttachDef.Type,
                subType        = entity.Components?.SAttachableComponentParams?.AttachDef.SubType,
                size           = entity.Components?.SAttachableComponentParams?.AttachDef.Size,
                grade          = entity.Components?.SAttachableComponentParams?.AttachDef.Grade,
                name           = entity.Components?.SAttachableComponentParams?.AttachDef.Localization.Name,
                tags           = entity.Components?.SAttachableComponentParams?.AttachDef.Tags,
                manufacturer   = manufacturerSvc.GetManufacturer(entity.Components?.SAttachableComponentParams?.AttachDef.Manufacturer, entity.ClassName)?.Code,
                classification = classification
            };

            return(indexEntry);
        }