Example #1
0
 public T_Detail(int X, int Y) : base(X, Y)
 {
     Cubes = PartDefinitions.GetPartDefinition(PartDefinitions.Definition.T_Detail);
     FindCentralCube();
     // set central cube position as a center of a part
     this.SetPos(PositionX, PositionY);
 }
Example #2
0
        public Part(int positionX, int positionY, PartDefinitions.Definition def = PartDefinitions.Definition.T_Detail, bool isRotatable = true)
        {
            this.PositionX = positionX;
            this.PositionY = positionY;

            if (def == PartDefinitions.Definition.ODetail)
            {
                isRotatable = false;
            }
            else
            {
                this._isRotatable = isRotatable;
            }

            this.Cubes   = PartDefinitions.GetPartDefinition(def);
            ModelObjects = new T[Cubes.Length];
            FindCentralCube();
            SetPos(positionX, positionY);
            for (int i = 0; i < Cubes.Length; i++)
            {
                ModelObjects[i] = (T) new T().Create(Cubes[i]);
            }
        }