Example #1
0
        public object Clone()
        {
            MyPlanetMaterialGroup clonedGroup = new MyPlanetMaterialGroup();

            clonedGroup.Value         = Value;
            clonedGroup.Name          = Name;
            clonedGroup.MaterialRules = new MyPlanetMaterialPlacementRule[MaterialRules.Length];
            for (int i = 0; i < MaterialRules.Length; i++)
            {
                clonedGroup.MaterialRules[i] = MaterialRules[i].Clone() as MyPlanetMaterialPlacementRule;
            }
            return(clonedGroup);
        }
            public PlanetBiome(MyPlanetMaterialGroup group)
            {
                Value = group.Value;

                Name = group.Name;

                Rules = new List<PlanetMaterialRule>(group.MaterialRules.Length);

                for (int i = 0; i < group.MaterialRules.Length; i++)
                {
                    Rules.Add(new PlanetMaterialRule(group.MaterialRules[i]));
                }

                MateriaTree = new MyDynamicAABBTree(Vector3.Zero);

                foreach (var rule in Rules)
                {
                    BoundingBox bb = new BoundingBox(new Vector3(rule.Height.Min, rule.Latitude.Min, rule.Longitude.Min), new Vector3(rule.Height.Max, rule.Latitude.Max, rule.Longitude.Max));
                    MateriaTree.AddProxy(ref bb, rule, 0);
                    if (rule.Latitude.Mirror)
                    {
                        float min = -bb.Max.Y;
                        bb.Max.Y = -bb.Min.Y;
                        bb.Min.Y = min;
                        MateriaTree.AddProxy(ref bb, rule, 0);
                    }
                }
            }
 public object Clone()
 {
     MyPlanetMaterialGroup clonedGroup = new MyPlanetMaterialGroup();
     clonedGroup.Value = Value;
     clonedGroup.Name = Name;
     clonedGroup.MaterialRules = new MyPlanetMaterialPlacementRule[MaterialRules.Length];
     for (int i = 0; i < MaterialRules.Length; i++)
         clonedGroup.MaterialRules[i] = MaterialRules[i].Clone() as MyPlanetMaterialPlacementRule;
     return clonedGroup;
 }