コード例 #1
0
        /// <summary>
        /// pass in something like this: 2,2|(990,991,1022,1023)|24,24|ROTATEFAST
        /// </summary>
        /// <param name="info"></param>
        public FrameFacet(string info)
        {
            string[] pieces   = info.Split('|');
            string[] subpiece = pieces[0].Split(',');
            width    = byte.Parse(subpiece[0]);
            height   = byte.Parse(subpiece[1]);
            subpiece = Acc.script_remove_outer_parentheses(pieces[1]).Split(',');
            images   = new int[subpiece.Length];
            for (int i = 0; i < images.Length; i++)
            {
                images[i] = int.Parse(subpiece[i]);
            }
            subpiece     = pieces[2].Split(',');
            attach_point = new Point(int.Parse(subpiece[0]), int.Parse(subpiece[1]));
            if (pieces.Length == 4)
            {
                center_of_rotation = new Point(0, 0);
                rotation_type      = (FACETTRACKERS)Enum.Parse(typeof(FACETTRACKERS), pieces[3]);
            }
            else
            {
                subpiece             = pieces[3].Split(',');
                center_of_rotation   = new Point(int.Parse(subpiece[0]), int.Parse(subpiece[1]));
                center_of_rotation.X = width * 12 - center_of_rotation.X;
                center_of_rotation.Y = height * 12 - center_of_rotation.Y;

                rotation_type = (FACETTRACKERS)Enum.Parse(typeof(FACETTRACKERS), pieces[4]);
            }
        }
コード例 #2
0
 public Facet(int furn_temp_id, Point world_furn_loc, int facet_temp_id, FrameFacet f)
 {
     rotation = 0;
     furniture_template_id = furn_temp_id;
     facet_template_id     = facet_temp_id;
     world_furniture_loc   = world_furn_loc;
     rotation_type         = f.rotation_type;
     offset_facet          = f.attach_point;
     center_of_rotation    = f.center_of_rotation;
 }