Ejemplo n.º 1
0
 public FoundRock(String contourName, FoundRockType type, FPoint pos, double radius, double scale, double angle)
 {
     this.type         = type;
     this.contour_name = contourName;
     this.position     = pos;
     this.radius       = radius;
     this.scale        = scale;
     this.angle        = angle;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a stone entity based on the information about detected contour
        /// </summary>
        /// <param name="contureName">contour name</param>
        /// <param name="position">contour position</param>
        /// <param name="templates">list of known templates</param>
        /// <returns></returns>
        private FoundRock CreateFoundRock(String contureName, FPoint position, Templates templates, double radius, double scale, double angle)
        {
            FoundRockType type = FoundRockType.GRAVITON;
            ContourRock   rck  = (templates.rockSettings.Where(name => name.contour_name.Equals(contureName))).First();

            if (rck.rock is Generator)
            {
                type = FoundRockType.GENERATOR;
            }
            if (rck.rock is BlackHole)
            {
                type = FoundRockType.BLACKHOLE;
            }
            if (rck.rock is Graviton)
            {
                type = FoundRockType.GRAVITON;
            }
            if (rck.rock is Magneton)
            {
                type = FoundRockType.MAGNETON;
            }

            return(new FoundRock(contureName, type, position, radius, scale, angle));
        }