public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters)
    {
        ModCreateSegmentEntityResults lmodcreatesetmentresults = new ModCreateSegmentEntityResults();
        bool flag = parameters.Cube == this.mQuarryType;

        if (parameters.Cube == Mk5QuarryType || (parameters.Cube == PlacementType && parameters.Value == Mk5QuarryPlacementValue))
        {
            parameters.ObjectType           = SpawnableObjectEnum.Quarry;
            lmodcreatesetmentresults.Entity = new Mk5Quarry(parameters, mMk5Config, XMLModVersion);
            return(lmodcreatesetmentresults);
        }

        if (flag)
        {
            string cubekey = global::TerrainData.GetCubeKey(parameters.Cube, parameters.Value);
            if (cubekey == "FlexibleGames.Mk4Quarry")
            {
                lmodcreatesetmentresults.Entity = new Mk4Quarry(parameters.Segment, parameters.X, parameters.Y, parameters.Z, parameters.Cube, parameters.Flags, parameters.Value, parameters.LoadFromDisk, mMk4Config);
            }
            else
            {
                lmodcreatesetmentresults.Entity = new AdvancedQuarrys(parameters.Segment, parameters.X, parameters.Y, parameters.Z, parameters.Cube, parameters.Flags, parameters.Value, parameters.LoadFromDisk, mConfig);
            }
        }
        return(lmodcreatesetmentresults);
    }
    public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters)
    {
        ModCreateSegmentEntityResults result = new ModCreateSegmentEntityResults();

        if (parameters.Cube == alCubeType)
        {
            parameters.ObjectType = SpawnableObjectEnum.MatterMover;
            result.Entity         = new ALS_MachineEntity(parameters);
        }
        return(result);
    }
Пример #3
0
    public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters)
    {
        ModCreateSegmentEntityResults result = new ModCreateSegmentEntityResults();

        //Assumes that all value entries are handled by the same machine!
        if (parameters.Cube == MyModMachineType)
        {
            result.Entity = new PowerDissipatorMachine(parameters);
        }
        return(result);
    }
Пример #4
0
    public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters)
    {
        ModCreateSegmentEntityResults result = new ModCreateSegmentEntityResults();

        if (parameters.Cube == AccessPortType)
        {
            parameters.ObjectType = SpawnableObjectEnum.RefineryController;
            result.Entity         = new MSAccessPort(parameters);
        }
        return(result);
    }
Пример #5
0
    public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters)
    {
        log(LOGGER_PREFIX, "creating with params: " +
            "X = " + parameters.X + ", " +
            "Y = " + parameters.Y + ", " +
            "Z = " + parameters.Z + ", " +
            "Cube = " + parameters.Cube + ", " +
            "Value = " + parameters.Value + ", " +
            "Segment = " + parameters.Segment + ", " +
            "Type = " + parameters.Type + ", " +
            "Flags = " + parameters.Flags + ", " +
            "toString = \"" + parameters.ToString() + "\""
            );
        ModCreateSegmentEntityResults res = new ModCreateSegmentEntityResults();

        if (parameters.Cube == powWowCube)
        {
            if (parameters.Value == powWowMk1Val)
            {
                res.Entity = new PowWowMk1(parameters);
            }
            if (parameters.Value == powWowMk2Val)
            {
                res.Entity = new PowWowMk2(parameters);
            }
            if (parameters.Value == powWowMk3Val)
            {
                res.Entity = new PowWowMk3(parameters);
            }
            if (parameters.Value == powWowMk4Val)
            {
                res.Entity = new PowWowMk4(parameters);
            }
        }

        if (parameters.Cube == compactSolarCube)
        {
            if (parameters.Value == compactSolarMk1Val)
            {
                res.Entity = new CompactSolarMk1(parameters);
            }
            if (parameters.Value == compactSolarMk2Val)
            {
                res.Entity = new CompactSolarMk2(parameters);
            }
            if (parameters.Value == compactSolarMk3Val)
            {
                res.Entity = new CompactSolarMk3(parameters);
            }
        }

        return(res);
    }
Пример #6
0
        public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters)
        {
            var results = new ModCreateSegmentEntityResults();

            if (parameters.Cube == this.TunnelBoreCubeType)
            {
                results.Entity = new TunnelBore(parameters.X, parameters.Y, parameters.Z, parameters.Cube,
                                                parameters.Flags, parameters.Value, parameters.Position, parameters.Segment);
            }

            return(results);
        }
Пример #7
0
    public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters)
    {
        ModCreateSegmentEntityResults result = new ModCreateSegmentEntityResults();

        //Assumes that all value entries are handled by the same machine!
        if (parameters.Cube == MyModMachineType)
        {
            //You can set what object model will be spawned in for the machine
            parameters.ObjectType = SpawnableObjectEnum.Conveyor;
            result.Entity         = new MyModMachine(parameters);
        }
        return(result);
    }
Пример #8
0
        public ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters)
        {
/*            log("Creating with params: " +
 *              "X = " + parameters.X + ", " +
 *              "Y = " + parameters.Y + ", " +
 *              "Z = " + parameters.Z + ", " +
 *              "Cube = " + parameters.Cube + ", " +
 *              "Value = " + parameters.Value + ", " +
 *              "Segment = " + parameters.Segment + ", " +
 *              "Type = " + parameters.Type + ", " +
 *              "Flags = " + parameters.Flags + ", " +
 *              "toString = \"" + parameters.ToString() + "\""
 *              );
 */
            ModCreateSegmentEntityResults res = new ModCreateSegmentEntityResults();

            MachineRegistration machineRegistration = RegistrationForCubeValue(parameters.Cube, parameters.Value);

            if (machineRegistration != null)
            {
                parameters.ObjectType = machineRegistration.objectType;
                parameters.Type       = eSegmentEntity.Mod;
                try
                {
                    res.Entity = (SegmentEntity)Activator.CreateInstance(machineRegistration.type, new Object[] { parameters });
                }
                catch (MissingMethodException e)
                {
                    log("No constructor for {1} that takes a ModCreateSegmentEntityParameters: {2}", machineRegistration.type.Name, e);
                }
            }
            else
            {
                log("Requested an unknown Segment Entity: " +
                    "X = " + parameters.X + ", " +
                    "Y = " + parameters.Y + ", " +
                    "Z = " + parameters.Z + ", " +
                    "Cube = " + parameters.Cube + ", " +
                    "Value = " + parameters.Value + ", " +
                    "Segment = " + parameters.Segment + ", " +
                    "Type = " + parameters.Type + ", " +
                    "Flags = " + parameters.Flags + ", " +
                    "toString = \"" + parameters.ToString() + "\""
                    );
            }

            return(res);
        }
Пример #9
0
    public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters)
    {
        ModCreateSegmentEntityResults result = new ModCreateSegmentEntityResults();

        if (parameters.Cube == QuantumStorageControllerType)
        {
            parameters.ObjectType = SpawnableObjectEnum.ResearchStation;
            result.Entity         = new QuantumStorageControllerMachine(parameters);
        }
        else if (parameters.Cube == QuantumStorageType)
        {
            parameters.ObjectType = SpawnableObjectEnum.Teleporter;
            if (parameters.Value == QuantumStorage1KValue)
            {
                result.Entity = new QuantumStorageMachine(parameters, 1024);
            }
            else if (parameters.Value == QuantumStorage2KValue)
            {
                result.Entity = new QuantumStorageMachine(parameters, 2048);
            }
            else if (parameters.Value == QuantumStorage4KValue)
            {
                result.Entity = new QuantumStorageMachine(parameters, 4096);
            }
            else
            {
                LogUtils.LogDebug(ModName, "QuantumStorageMachine missing entity");
            }
        }
        else if (parameters.Cube == QuantumIoPortType)
        {
            parameters.ObjectType = SpawnableObjectEnum.ResearchStation;
            result.Entity         = new QuantumIoPortMachine(parameters);
        }
        else if (parameters.Cube == QuantumOutputPortType)
        {
            parameters.ObjectType = SpawnableObjectEnum.DirectionalHopper;
            result.Entity         = new QuantumOutputPortMachine(parameters);
        }
        else if (parameters.Cube == QuantumInputPortType)
        {
            parameters.ObjectType = SpawnableObjectEnum.DirectionalHopper;
            result.Entity         = new QuantumInputPortMachine(parameters);
        }

        return(result);
    }
Пример #10
0
    public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters)
    {
        ModCreateSegmentEntityResults lcser = new ModCreateSegmentEntityResults();
        bool flag = parameters.Cube == this.mExcavatorCubeType;

        if (flag)
        {
            if (mXMLFileExists)
            {
                lcser.Entity = new Mk2Excavator(parameters.Segment, parameters.X, parameters.Y, parameters.Z, parameters.Cube, parameters.Flags, parameters.Value, parameters.LoadFromDisk, mConfig.PowerPerBlockDefault, mConfig.PowerPerBlockOre, mConfig.DigRadius, mConfig.DigHeight, mConfig.MaxPower, mConfig.OPBlock);
            }
            else
            {
                Debug.LogWarning("Mk2Excavator: ERROR: XMLConfig File Does not exist, using defaults.");
                lcser.Entity = new Mk2Excavator(parameters.Segment, parameters.X, parameters.Y, parameters.Z, parameters.Cube, parameters.Flags, parameters.Value, parameters.LoadFromDisk, 20, 80, 9, 128, 1280, 5);
            }
        }
        return(lcser);
    }
Пример #11
0
    public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters)
    {
        ModCreateSegmentEntityResults result = new ModCreateSegmentEntityResults();

        if (parameters.Cube == ManufacturerType)
        {
            parameters.ObjectType = SpawnableObjectEnum.MassStorageOutputPort;
            result.Entity         = new MSManufacturer(parameters);
        }

        //foreach (ModCubeMap cubeMap in ModManager.mModMappings.CubeTypes)
        //{
        //    if (cubeMap.CubeType == parameters.Cube)
        //    {
        //        if (cubeMap.Key.Equals("steveman0.MSManufacturer") || cubeMap.Key.Equals("steveman0.MSManufacturerMK1") || cubeMap.Key.Equals("steveman0.MSManufacturerMK2") || cubeMap.Key.Equals("steveman0.MSManufacturerMK3"))
        //            result.Entity = new MSManufacturer(parameters.Segment, parameters.X, parameters.Y, parameters.Z, parameters.Cube, parameters.Flags, parameters.Value, parameters.LoadFromDisk);
        //    }
        //}
        return(result);
    }
Пример #12
0
    public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters)
    {
        ModCreateSegmentEntityResults result = new ModCreateSegmentEntityResults();

        if (parameters.Cube == TrackJunctionType)
        {
            parameters.ObjectType = SpawnableObjectEnum.Minecart_Track_Straight;
            result.Entity         = new FreightTrackJunction(parameters);
        }
        else if (parameters.Cube == StationType)
        {
            parameters.ObjectType = SpawnableObjectEnum.Minecart_Track_LoadStation;
            result.Entity         = new FreightCartStation(parameters);
        }
        else if (parameters.Cube == SystemMonitorType)
        {
            parameters.ObjectType = SpawnableObjectEnum.AutoBuilder;
            result.Entity         = new FreightSystemMonitor(parameters);
        }
        else if (parameters.Cube == FactoryType)
        {
            parameters.ObjectType = SpawnableObjectEnum.Minecart_Track_Factory;
            result.Entity         = new FreightCartFactory(parameters);
        }
        else if (parameters.Cube == TourStationType)
        {
            parameters.ObjectType = SpawnableObjectEnum.Minecart_Track_Factory;
            result.Entity         = new TourCartStation(parameters);
        }
        else if (parameters.Cube == ScrapTrackType)
        {
            // No Object - rendered separately
            parameters.ObjectType = SpawnableObjectEnum.XXX;
            result.Entity         = new ScrapTrack(parameters);
        }
        return(result);
    }
Пример #13
0
    public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters)
    {
        log(LOGGER_PREFIX, "creating with params: " +
            "X = " + parameters.X + ", " +
            "Y = " + parameters.Y + ", " +
            "Z = " + parameters.Z + ", " +
            "Cube = " + parameters.Cube + ", " +
            "Value = " + parameters.Value + ", " +
            "Segment = " + parameters.Segment + ", " +
            "Type = " + parameters.Type + ", " +
            "Flags = " + parameters.Flags + ", " +
            "toString = \"" + parameters.ToString() + "\""
            );
        ModCreateSegmentEntityResults res = new ModCreateSegmentEntityResults();

        if (parameters.Cube == powWowCube)
        {
            if (parameters.Value == powWowMk1Val)
            {
                res.Entity = new PowWowMk1(parameters);
            }
            if (parameters.Value == powWowMk2Val)
            {
                res.Entity = new PowWowMk2(parameters);
            }
            if (parameters.Value == powWowMk3Val)
            {
                res.Entity = new PowWowMk3(parameters);
            }
            if (parameters.Value == powWowMk4Val)
            {
                res.Entity = new PowWowMk4(parameters);
            }
        }

        if (parameters.Cube == compactSolarCube)
        {
            if (parameters.Value == compactSolarMk1Val)
            {
                res.Entity = new CompactSolarMk1(parameters);
            }
            if (parameters.Value == compactSolarMk2Val)
            {
                res.Entity = new CompactSolarMk2(parameters);
            }
            if (parameters.Value == compactSolarMk3Val)
            {
                res.Entity = new CompactSolarMk3(parameters);
            }
        }

        if (parameters.Cube == massGiverCube)
        {
            if (parameters.Value == massGiverVanillaValue)
            {
                res.Entity = new MassGiverVanilla(parameters);
            }
            if (parameters.Value == massGiverMk1Value)
            {
                res.Entity = new MassGiverMk1(parameters);
            }
            if (parameters.Value == massGiverMk2Value)
            {
                res.Entity = new MassGiverMk2(parameters);
            }
            if (parameters.Value == massGiverMk3Value)
            {
                res.Entity = new MassGiverMk3(parameters);
            }
            if (parameters.Value == massGiverMk4Value)
            {
                res.Entity = new MassGiverMk4(parameters);
            }
            if (parameters.Value == massGiverMk5Value)
            {
                res.Entity = new MassGiverMk5(parameters);
            }
        }

        if (parameters.Cube == massCrateModuleCube)
        {
            if (parameters.Value == massCrateModuleVanillaValue)
            {
                res.Entity = new MassCrateModuleVanilla(parameters);
            }
            if (parameters.Value == massCrateModuleLinkerValue)
            {
                res.Entity = new MassCrateModuleLinker(parameters);
            }
            if (parameters.Value == massCrateModule100Value)
            {
                res.Entity = new MassCrateModule100(parameters);
            }
            if (parameters.Value == massCrateModule200Value)
            {
                res.Entity = new MassCrateModule200(parameters);
            }
            if (parameters.Value == massCrateModule500Value)
            {
                res.Entity = new MassCrateModule500(parameters);
            }
            if (parameters.Value == massCrateModule1000Value)
            {
                res.Entity = new MassCrateModule1000(parameters);
            }
            if (parameters.Value == massCrateModule10000Value)
            {
                res.Entity = new MassCrateModule10000(parameters);
            }
            if (parameters.Value == massCrateModulePoweredMk1Value)
            {
                res.Entity = new MassCrateModulePoweredMk1(parameters);
            }
        }

        if (parameters.Cube == massTakerCube)
        {
            if (parameters.Value == massTakerVanillaValue)
            {
                res.Entity = new MassTakerVanilla(parameters);
            }
            if (parameters.Value == massTakerMk1Value)
            {
                res.Entity = new MassTakerMk1(parameters);
            }
            if (parameters.Value == massTakerMk2Value)
            {
                res.Entity = new MassTakerMk2(parameters);
            }
            if (parameters.Value == massTakerMk3Value)
            {
                res.Entity = new MassTakerMk3(parameters);
            }
            if (parameters.Value == massTakerMk4Value)
            {
                res.Entity = new MassTakerMk4(parameters);
            }
            if (parameters.Value == massTakerMk5Value)
            {
                res.Entity = new MassTakerMk5(parameters);
            }
        }

        return(res);
    }
        public override void CreateSegmentEntity(ModCreateSegmentEntityParameters parameters, ModCreateSegmentEntityResults results)
        {
            var data = TerrainData.mEntries[parameters.Cube];
            EntityConstructor ctor;

            if (!_constructors.TryGetValue(data.Key, out ctor))
            {
                TerrainDataValueEntry value = data.GetValue(parameters.Value);
                if (value == null || !_constructors.TryGetValue(value.Key, out ctor))
                {
                    Debug.LogWarning($"LogicLasers CreateSegmentEntity called with unrecognized parameters? Cube: {parameters.Cube} Value {parameters.Value}");
                    return;
                }
            }
            results.Entity = ctor(parameters.Segment, parameters.X, parameters.Y, parameters.Z, parameters.Cube, parameters.Flags, parameters.Value);
        }
Пример #15
0
        public sealed override void CreateSegmentEntity(ModCreateSegmentEntityParameters parameters, ModCreateSegmentEntityResults results)
        {
            var material = new Block.Material(parameters.Cube, parameters.Value);

            parameters.ObjectType = SpawnableObjectEnum.Num;
            results.Entity        = this.BlockRegistrations[material](parameters);
        }
Пример #16
0
    public override void CreateSegmentEntity(ModCreateSegmentEntityParameters parameters, ModCreateSegmentEntityResults results)
    {
        //Makes sure that all hoppers has the LogisticsHopper model
        parameters.ObjectType = SpawnableObjectEnum.LogisticsHopper;
        //Default Custom Storage Hopper values
        ushort HopperMaxStorage = 10;
        float  HopperColorR     = 1;
        float  HopperColorG     = 2;
        float  HopperColorB     = 3;
        string HopperName       = "NO NAME";
        bool   HopperOT         = false;
        Color  HopperColor      = new Color(1, 2, 3);

        //Starts to parse the parameteres from the xml file into values
        if (parameters.Cube == mHopperCubeType)
        {
            var entry = mHopperCubeEntry.GetValue(parameters.Value);
            if (entry != null && entry.Custom != null)
            {
                //Trys to log what the values loaded for custom hoppers are, this is to debug
                try
                {
                    HopperMaxStorage = Convert.ToUInt16(entry.Custom.GetValue("Tricky.MaxStorage"));
                    Variables.LogValue("HopperMaxStorage", HopperMaxStorage);
                    HopperColorR = float.Parse(entry.Custom.GetValue("Tricky.ColorR"), CultureInfo.InvariantCulture.NumberFormat);
                    Variables.LogValue("HopperColorR", HopperColorR);
                    HopperColorG = float.Parse(entry.Custom.GetValue("Tricky.ColorG"), CultureInfo.InvariantCulture.NumberFormat);
                    Variables.LogValue("HopperColorG", HopperColorG);
                    HopperColorB = float.Parse(entry.Custom.GetValue("Tricky.ColorB"), CultureInfo.InvariantCulture.NumberFormat);
                    Variables.LogValue("HopperColorB", HopperColorB);
                    HopperColor = new Color(HopperColorR, HopperColorG, HopperColorB);
                    Variables.LogValue("HopperColor", HopperColor);
                    HopperName = entry.Custom.GetValue("Tricky.HopperName");
                    Variables.LogValue("HopperName", HopperName);
                    HopperOT = Convert.ToBoolean(entry.Custom.GetValue("Tricky.OT"));
                    Variables.LogValue("HopperOT", HopperOT);
                }
                catch (Exception)
                {
                    Variables.LogError("Something went wrong, when loading values for a hopper!");
                    results.Entity = null;
                    return;

                    throw;
                }
            }
            //Moves the variables into a new hopper, and uses the functions from ExtraStorageHoppers.cs
            results.Entity = new ExtraStorageHoppers(parameters, HopperMaxStorage, HopperColor, HopperName, HopperOT);
        }
        return;
    }
Пример #17
0
 public override void CreateSegmentEntity(ModCreateSegmentEntityParameters param, ModCreateSegmentEntityResults results)
 {
     if (param.Type == eSegmentEntity.OreSmelter)
     {
         results.Entity = UndergroundSmelter.CreateSmelter(param);
     }
     if (param.Type == eSegmentEntity.ForcedInduction)
     {
         results.Entity = UndergroundInduction.CreateInduction(param);
     }
 }