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); }
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]); } }
/// <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()); }
/// <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(); }