示例#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);
 }
示例#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]);
            }
        }
示例#3
0
 /// <summary>
 /// Retrieve analysis of a specific part definition given its (attributed)
 /// implementation type.
 /// </summary>
 /// <param name="attributedPartType">The implementation type of the part definition.</param>
 /// <returns>Analysis of the part definition.</returns>
 /// <remarks>The part must be a member of the catalog being analyzed.</remarks>
 public PartDefinitionInfo GetPartDefinitionInfo(Type attributedPartType)
 {
     return(PartDefinitions
            .Where(pd => ReflectionModelServices.GetPartType(pd.PartDefinition).Value == attributedPartType)
            .SingleOrDefault());
 }
示例#4
0
 /// <summary>
 /// Retrieve analysis of a specific part definition given the name of its
 /// (attributed) implementation type.
 /// </summary>
 /// <param name="typeName">The FullName of the implementation type of the part definition.</param>
 /// <returns>Analysis of the part definition.</returns>
 /// <remarks>The part must be a member of the catalog being analyzed.</remarks>
 public PartDefinitionInfo GetPartDefinitionInfo(string typeName)
 {
     return(PartDefinitions
            .Where(pd => ReflectionModelServices.GetPartType(pd.PartDefinition).Value.FullName == typeName)
            .SingleOrDefault());
 }
 internal TypeDefinitionGeneratorOfT(MemberInfoList memberInfoList, NameDefinition nameDefinition, PartDefinitions partDefinitions)
 {
     this.nameDefinition = nameDefinition;
     this.memberInfoList = memberInfoList;
     Definitions         = new LinkedDefinitions <T>(partDefinitions).ToArray();
 }