Exemple #1
0
 public LaunchMatchmakingResultEvent(LaunchMatchmakingResultEvent other)
     : this()
 {
     fightDefId_    = other.fightDefId_;
     result_        = other.result_;
     _unknownFields = UnknownFieldSet.Clone(other._unknownFields);
 }
Exemple #2
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Types.Assembly assembly = new Types.Assembly();
            DA.GetData <Types.Assembly>("Material", ref assembly);


            GH_Point   point          = new GH_Point();
            GH_Integer piles          = new GH_Integer(1);
            GH_Number  radius         = new GH_Number(0);
            GH_Number  plateThickness = new GH_Number(0);
            GH_Number  plateLength    = new GH_Number(0);
            GH_Number  plateWidth     = new GH_Number(0);
            GH_Number  pileLength     = new GH_Number(0);

            DA.GetData <GH_Point>("Point", ref point);
            DA.GetData <GH_Number>("Pile Radius", ref radius);
            DA.GetData <GH_Integer>("Piles", ref piles);
            DA.GetData <GH_Number>("Plate Thickness", ref plateThickness);
            DA.GetData <GH_Number>("Plate Length", ref plateLength);
            DA.GetData <GH_Number>("Plate Width", ref plateWidth);
            DA.GetData <GH_Number>("Pile Length", ref pileLength);


            drawExtrusion(point.Value, plateLength.Value, plateWidth.Value, plateThickness.Value);
            Rhino.Geometry.Circle circle = new Rhino.Geometry.Circle(point.Value, (plateWidth.Value / 2) * 0.8);

            double numberOfPiles = piles.Value;

            for (int i = 1; i <= piles.Value; i++)
            {
                double iteration = i;
                double factor    = 2.0 * Math.PI * (iteration / numberOfPiles);
                Rhino.Geometry.Point3d center = (piles.Value == 1)? point.Value : circle.ToNurbsCurve().PointAt(factor);
                drawColumn(center, pileLength.Value, radius.Value);
            }


            double calculationVolume = (piles.Value * pileLength.Value * radius.Value) + (plateThickness.Value * plateLength.Value * plateWidth.Value);


            Types.Result result = new Types.Result()
            {
                GlobalWarmingPotential     = new Types.UnitDouble <Types.LCA.CO2e>(assembly.GlobalWarmingPotential.Value * calculationVolume),
                Acidification              = new Types.UnitDouble <Types.LCA.kgSO2>(assembly.Acidification.Value * calculationVolume),
                DepletionOfNonrenewbles    = new Types.UnitDouble <Types.LCA.MJ>(assembly.DepletionOfNonrenewbles.Value * calculationVolume),
                DepletionOfOzoneLayer      = new Types.UnitDouble <Types.LCA.kgCFC11>(assembly.DepletionOfOzoneLayer.Value * calculationVolume),
                Eutrophication             = new Types.UnitDouble <Types.LCA.kgPhostphate>(assembly.Eutrophication.Value * calculationVolume),
                FormationTroposphericOzone = new Types.UnitDouble <Types.LCA.kgNOx>(assembly.FormationTroposphericOzone.Value * calculationVolume)
            };



            DA.SetData("LCA Result", result);
        }
Exemple #3
0
 public void MergeFrom(LaunchMatchmakingResultEvent other)
 {
     if (other != null)
     {
         if (other.FightDefId != 0)
         {
             FightDefId = other.FightDefId;
         }
         if (other.Result != 0)
         {
             Result = other.Result;
         }
         _unknownFields = UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
     }
 }
Exemple #4
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Types.Assembly assembly = new Types.Assembly();
            DA.GetData <Types.Assembly>("Material", ref assembly);

            GH_Brep   brep   = new GH_Brep();
            GH_Number volume = new GH_Number(0);

            if (!DA.GetData <GH_Number>("Volume", ref volume))
            {
                volume = new GH_Number(0);
            }
            if (!DA.GetData <GH_Brep>("Brep", ref brep))
            {
                brep = new GH_Brep();
            }

            double calculationVolume = volume.Value;

            if (brep.Value != null)
            {
                calculationVolume += brep.Value.GetVolume();
            }



            Types.Result result = new Types.Result()
            {
                GlobalWarmingPotential     = new Types.UnitDouble <Types.LCA.CO2e>(assembly.GlobalWarmingPotential.Value * calculationVolume),
                Acidification              = new Types.UnitDouble <Types.LCA.kgSO2>(assembly.Acidification.Value * calculationVolume),
                DepletionOfNonrenewbles    = new Types.UnitDouble <Types.LCA.MJ>(assembly.DepletionOfNonrenewbles.Value * calculationVolume),
                DepletionOfOzoneLayer      = new Types.UnitDouble <Types.LCA.kgCFC11>(assembly.DepletionOfOzoneLayer.Value * calculationVolume),
                Eutrophication             = new Types.UnitDouble <Types.LCA.kgPhostphate>(assembly.Eutrophication.Value * calculationVolume),
                FormationTroposphericOzone = new Types.UnitDouble <Types.LCA.kgNOx>(assembly.FormationTroposphericOzone.Value * calculationVolume)
            };



            DA.SetData("LCA Result", result);
        }
Exemple #5
0
        public void MergeFrom(CodedInputStream input)
        {
            uint num;

            while ((num = input.ReadTag()) != 0)
            {
                switch (num)
                {
                default:
                    _unknownFields = UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 8u:
                    FightDefId = input.ReadInt32();
                    break;

                case 16u:
                    result_ = (Types.Result)input.ReadEnum();
                    break;
                }
            }
        }
Exemple #6
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Types.Assembly assembly = new Types.Assembly();
            DA.GetData <Types.Assembly>("Material", ref assembly);

            GH_Number  area    = new GH_Number(0);
            GH_Surface surface = new GH_Surface();

            if (!DA.GetData <GH_Number>("Area", ref area))
            {
                area = new GH_Number(0);
            }
            if (!DA.GetData <GH_Surface>("Surface", ref surface))
            {
                surface = new GH_Surface();
            }

            double calculationArea = area.Value;

            if (surface.Value != null)
            {
                calculationArea += surface.Value.GetArea();
            }

            Types.Result result = new Types.Result()
            {
                GlobalWarmingPotential     = new Types.UnitDouble <Types.LCA.CO2e>(assembly.GlobalWarmingPotential.Value * calculationArea),
                Acidification              = new Types.UnitDouble <Types.LCA.kgSO2>(assembly.Acidification.Value * calculationArea),
                DepletionOfNonrenewbles    = new Types.UnitDouble <Types.LCA.MJ>(assembly.DepletionOfNonrenewbles.Value * calculationArea),
                DepletionOfOzoneLayer      = new Types.UnitDouble <Types.LCA.kgCFC11>(assembly.DepletionOfOzoneLayer.Value * calculationArea),
                Eutrophication             = new Types.UnitDouble <Types.LCA.kgPhostphate>(assembly.Eutrophication.Value * calculationArea),
                FormationTroposphericOzone = new Types.UnitDouble <Types.LCA.kgNOx>(assembly.FormationTroposphericOzone.Value * calculationArea)
            };



            DA.SetData("LCA Result", result);
        }
Exemple #7
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Types.Assembly assembly = new Types.Assembly();
            DA.GetData<Types.Assembly>("Material", ref assembly);

            GH_Brep brep = new GH_Brep();
            GH_Number volume = new GH_Number(0);

            if (!DA.GetData<GH_Number>("Volume", ref volume)) volume = new GH_Number(0);
            if (!DA.GetData<GH_Brep>("Brep", ref brep)) brep = new GH_Brep();

            double calculationVolume = volume.Value;
            if (brep.Value != null) calculationVolume += brep.Value.GetVolume();

            Types.Result result = new Types.Result()
            {
                GlobalWarmingPotential = new Types.UnitDouble<Types.LCA.CO2e>(assembly.GlobalWarmingPotential.Value * calculationVolume),
                Acidification = new Types.UnitDouble<Types.LCA.kgSO2>(assembly.Acidification.Value * calculationVolume),
                DepletionOfNonrenewbles = new Types.UnitDouble<Types.LCA.MJ>(assembly.DepletionOfNonrenewbles.Value * calculationVolume),
                DepletionOfOzoneLayer = new Types.UnitDouble<Types.LCA.kgCFC11>(assembly.DepletionOfOzoneLayer.Value * calculationVolume),
                Eutrophication = new Types.UnitDouble<Types.LCA.kgPhostphate>(assembly.Eutrophication.Value * calculationVolume),
                FormationTroposphericOzone = new Types.UnitDouble<Types.LCA.kgNOx>(assembly.FormationTroposphericOzone.Value * calculationVolume)
            };

            DA.SetData("LCA Result", result);
        }
Exemple #8
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Types.Assembly assembly = new Types.Assembly();
            DA.GetData<Types.Assembly>("Material", ref assembly);

            GH_Number area = new GH_Number(0);
            GH_Surface surface = new GH_Surface();

            if (!DA.GetData<GH_Number>("Area", ref area)) area = new GH_Number(0);
            if (!DA.GetData<GH_Surface>("Surface", ref surface)) surface = new GH_Surface();

            double calculationArea = area.Value;
            if (surface.Value != null) calculationArea += surface.Value.GetArea();

            Types.Result result = new Types.Result()
            {
                GlobalWarmingPotential = new Types.UnitDouble<Types.LCA.CO2e>(assembly.GlobalWarmingPotential.Value * calculationArea),
                Acidification = new Types.UnitDouble<Types.LCA.kgSO2>(assembly.Acidification.Value * calculationArea),
                DepletionOfNonrenewbles = new Types.UnitDouble<Types.LCA.MJ>(assembly.DepletionOfNonrenewbles.Value * calculationArea),
                DepletionOfOzoneLayer = new Types.UnitDouble<Types.LCA.kgCFC11>(assembly.DepletionOfOzoneLayer.Value * calculationArea),
                Eutrophication = new Types.UnitDouble<Types.LCA.kgPhostphate>(assembly.Eutrophication.Value * calculationArea),
                FormationTroposphericOzone = new Types.UnitDouble<Types.LCA.kgNOx>(assembly.FormationTroposphericOzone.Value * calculationArea)
            };

            DA.SetData("LCA Result", result);
        }
Exemple #9
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Types.Assembly assembly = new Types.Assembly();
            DA.GetData<Types.Assembly>("Material", ref assembly);

            GH_Curve curve = new GH_Curve();
            GH_Number radius = new GH_Number(0);
            GH_Number height = new GH_Number(0);
            GH_Number width = new GH_Number(0);
            Types.Profile profile = null;

            if (!DA.GetData<GH_Number>("Radius", ref radius)) radius.Value = 0;
            if (!DA.GetData<GH_Number>("Height", ref height)) height.Value = 0;
            if (!DA.GetData<GH_Number>("Width", ref width)) width.Value = 0;
            if (!DA.GetData<Types.Profile>("Profile", ref profile)) profile = null;
            DA.GetData<GH_Curve>("Curve", ref curve);

            double calculationVolume = 0;

            if (profile != null)
            {
                calculationVolume = curve.Value.GetLength() * profile.Area;
                drawColumn(curve.Value.PointAtStart, curve.Value.PointAtEnd, profile.Area);
            }
            else
            {
                if (radius.Value > 0)
                {
                    drawColumn(curve.Value.PointAtStart, curve.Value.PointAtEnd, radius.Value);
                    calculationVolume = curve.Value.GetLength() * radius.Value * radius.Value * Math.PI;
                }
                else
                {
                    drawColumn(curve.Value.PointAtStart, curve.Value.PointAtEnd, height.Value, width.Value);
                    calculationVolume = curve.Value.GetLength() * height.Value * width.Value;
                }
            }

            Types.Result result = new Types.Result()
            {
                GlobalWarmingPotential = new Types.UnitDouble<Types.LCA.CO2e>(assembly.GlobalWarmingPotential.Value * calculationVolume),
                Acidification = new Types.UnitDouble<Types.LCA.kgSO2>(assembly.Acidification.Value * calculationVolume),
                DepletionOfNonrenewbles = new Types.UnitDouble<Types.LCA.MJ>(assembly.DepletionOfNonrenewbles.Value * calculationVolume),
                DepletionOfOzoneLayer = new Types.UnitDouble<Types.LCA.kgCFC11>(assembly.DepletionOfOzoneLayer.Value * calculationVolume),
                Eutrophication = new Types.UnitDouble<Types.LCA.kgPhostphate>(assembly.Eutrophication.Value * calculationVolume),
                FormationTroposphericOzone = new Types.UnitDouble<Types.LCA.kgNOx>(assembly.FormationTroposphericOzone.Value * calculationVolume)
            };

            DA.SetData("LCA Result", result);
        }
Exemple #10
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Types.Assembly assembly = new Types.Assembly();
            DA.GetData<Types.Assembly>("Material", ref assembly);

            GH_Point point = new GH_Point();
            GH_Integer piles = new GH_Integer(1);
            GH_Number radius = new GH_Number(0);
            GH_Number plateThickness = new GH_Number(0);
            GH_Number plateLength = new GH_Number(0);
            GH_Number plateWidth = new GH_Number(0);
            GH_Number pileLength = new GH_Number(0);

            DA.GetData<GH_Point>("Point", ref point);
            DA.GetData<GH_Number>("Pile Radius", ref radius);
            DA.GetData<GH_Integer>("Piles", ref piles);
            DA.GetData<GH_Number>("Plate Thickness", ref plateThickness);
            DA.GetData<GH_Number>("Plate Length", ref plateLength);
            DA.GetData<GH_Number>("Plate Width", ref plateWidth);
            DA.GetData<GH_Number>("Pile Length", ref pileLength);

            drawExtrusion(point.Value, plateLength.Value, plateWidth.Value, plateThickness.Value);
            Rhino.Geometry.Circle circle = new Rhino.Geometry.Circle(point.Value, (plateWidth.Value / 2) * 0.8);

            double numberOfPiles = piles.Value;

            for (int i = 1; i <= piles.Value; i++)
            {
                double iteration = i;
                double factor = 2.0 * Math.PI * (iteration / numberOfPiles);
                Rhino.Geometry.Point3d center = (piles.Value == 1)? point.Value : circle.ToNurbsCurve().PointAt(factor);
                drawColumn(center, pileLength.Value, radius.Value);
            }

            double calculationVolume = (piles.Value * pileLength.Value * radius.Value) + (plateThickness.Value * plateLength.Value * plateWidth.Value);

            Types.Result result = new Types.Result()
            {
                GlobalWarmingPotential = new Types.UnitDouble<Types.LCA.CO2e>(assembly.GlobalWarmingPotential.Value * calculationVolume),
                Acidification = new Types.UnitDouble<Types.LCA.kgSO2>(assembly.Acidification.Value * calculationVolume),
                DepletionOfNonrenewbles = new Types.UnitDouble<Types.LCA.MJ>(assembly.DepletionOfNonrenewbles.Value * calculationVolume),
                DepletionOfOzoneLayer = new Types.UnitDouble<Types.LCA.kgCFC11>(assembly.DepletionOfOzoneLayer.Value * calculationVolume),
                Eutrophication = new Types.UnitDouble<Types.LCA.kgPhostphate>(assembly.Eutrophication.Value * calculationVolume),
                FormationTroposphericOzone = new Types.UnitDouble<Types.LCA.kgNOx>(assembly.FormationTroposphericOzone.Value * calculationVolume)
            };

            DA.SetData("LCA Result", result);
        }
Exemple #11
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Types.Assembly assembly = new Types.Assembly();
            DA.GetData <Types.Assembly>("Material", ref assembly);

            GH_Curve  curve  = new GH_Curve();
            GH_Number radius = new GH_Number(0);
            GH_Number height = new GH_Number(0);
            GH_Number width  = new GH_Number(0);

            Types.Profile profile = null;

            if (!DA.GetData <GH_Number>("Radius", ref radius))
            {
                radius.Value = 0;
            }
            if (!DA.GetData <GH_Number>("Height", ref height))
            {
                height.Value = 0;
            }
            if (!DA.GetData <GH_Number>("Width", ref width))
            {
                width.Value = 0;
            }
            if (!DA.GetData <Types.Profile>("Profile", ref profile))
            {
                profile = null;
            }
            DA.GetData <GH_Curve>("Curve", ref curve);

            double calculationVolume = 0;


            if (profile != null)
            {
                calculationVolume = curve.Value.GetLength() * profile.Area;
                drawColumn(curve.Value.PointAtStart, curve.Value.PointAtEnd, profile.Area);
            }
            else
            {
                if (radius.Value > 0)
                {
                    drawColumn(curve.Value.PointAtStart, curve.Value.PointAtEnd, radius.Value);
                    calculationVolume = curve.Value.GetLength() * radius.Value * radius.Value * Math.PI;
                }
                else
                {
                    drawColumn(curve.Value.PointAtStart, curve.Value.PointAtEnd, height.Value, width.Value);
                    calculationVolume = curve.Value.GetLength() * height.Value * width.Value;
                }
            }



            Types.Result result = new Types.Result()
            {
                GlobalWarmingPotential     = new Types.UnitDouble <Types.LCA.CO2e>(assembly.GlobalWarmingPotential.Value * calculationVolume),
                Acidification              = new Types.UnitDouble <Types.LCA.kgSO2>(assembly.Acidification.Value * calculationVolume),
                DepletionOfNonrenewbles    = new Types.UnitDouble <Types.LCA.MJ>(assembly.DepletionOfNonrenewbles.Value * calculationVolume),
                DepletionOfOzoneLayer      = new Types.UnitDouble <Types.LCA.kgCFC11>(assembly.DepletionOfOzoneLayer.Value * calculationVolume),
                Eutrophication             = new Types.UnitDouble <Types.LCA.kgPhostphate>(assembly.Eutrophication.Value * calculationVolume),
                FormationTroposphericOzone = new Types.UnitDouble <Types.LCA.kgNOx>(assembly.FormationTroposphericOzone.Value * calculationVolume)
            };



            DA.SetData("LCA Result", result);
        }