Ejemplo n.º 1
0
 void RegisterMultiblockBuilder(Multiblock.Materials materials, Multiblock.Builder builder)
 {
     foreach (var placement in materials.Placements)
     {
         this.MultiblockBuilders[placement] = builder;
     }
 }
Ejemplo n.º 2
0
        /// register your multiblock machine if you want to see it in the game
        /// this method can be used to create complex entities
        /// key is prefix for your enties for Control and Filler blocks in TerrainData.xml file
        /// placementSuffixes is a list of all the suffixes such as TerrainData.xml has entry key + placementSuffix[i]
        /// that way you can build machine from different blocks
        /// creators are the same as for RegisterBoxMultiblock
        /// builder controls how and from what machine is being built
        /// it is recommended to save result of this method in public static to access it from machine constructor
        protected Multiblock.Materials RegisterMultiblock(
            string key,
            List <string> placementSuffixes,
            EntityCreator controlCreator,
            EntityCreator fillerCreator,
            Multiblock.Builder builder
            )
        {
            var materials = this.RegisterMultiblockNoBuilder(key, placementSuffixes, controlCreator, fillerCreator);

            this.RegisterMultiblockBuilder(materials, builder);
            return(materials);
        }