当前位置: 首页>>代码示例>>C#>>正文


C# StructureType类代码示例

本文整理汇总了C#中StructureType的典型用法代码示例。如果您正苦于以下问题:C# StructureType类的具体用法?C# StructureType怎么用?C# StructureType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StructureType类属于命名空间,在下文中一共展示了StructureType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DontSimplifySegmentStruct

		public void DontSimplifySegmentStruct()
		{
			StructureType s = new StructureType(null, 0) { Fields = { { 0, PrimitiveType.Int32 } } };
			s.IsSegment = true;
			DataType dt = s.Simplify();
			Assert.AreEqual("(segment (0 int32 dw0000))", dt.ToString());
		}
开发者ID:killbug2004,项目名称:reko,代码行数:7,代码来源:StructureTypeTests.cs

示例2: UnifyStructsSameSize

		public void UnifyStructsSameSize()
		{
			StructureType s1 = new StructureType(null, 20);
			StructureType s2 = new StructureType(null, 20);
			StructureType m = (StructureType) un.Unify(s1, s2);
			Assert.AreEqual(20, m.Size);
		}
开发者ID:gitter-badger,项目名称:reko,代码行数:7,代码来源:UnifierTests.cs

示例3: StrFldMerger_SingleMember

 public void StrFldMerger_SingleMember()
 {
     StructureType str = new StructureType("foo", 0);
     str.Fields.Add(4, PrimitiveType.Word16);
     DataType dt = sfm.Merge(str);
     Assert.AreEqual("(struct \"foo\" (4 word16 w0004))", dt.ToString());
 }
开发者ID:killbug2004,项目名称:reko,代码行数:7,代码来源:StructureFieldMergerTests.cs

示例4: VisitStructure

 public override DataType VisitStructure(StructureType str)
 {
     if (visitedTypes.Contains(str))
         return str;
     visitedTypes.Add(str);
     return base.VisitStructure(str);
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:7,代码来源:TypeVariableReplacer.cs

示例5: AddStructure

 public AddStructure(Position position, StructureType structureType, Facing frontFace)
     : this()
 {
     Position = position;
     StructureType = structureType;
     FrontFace = frontFace;
 }
开发者ID:MagistrAVSH,项目名称:voxelgame,代码行数:7,代码来源:AddStructure.cs

示例6: CreateDataType

 public DataType CreateDataType()
 {
     var str = new StructureType("foo", 0);
     str.Fields.Add(0, PrimitiveType.Int32);
     str.Fields.Add(4, new Pointer(str, 4));
     return str;
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:7,代码来源:CodeViewerFrame.cs

示例7: Setup

		public void Setup()
		{
            var image = new LoadedImage(Address.Ptr32(0x00100000), new byte[1024]);
            var arch = new FakeArchitecture();
            var program = new Program
            {
                Image = image,
                Architecture = arch,
                ImageMap = image.CreateImageMap(),
                Platform = new DefaultPlatform(null, arch),
            };
            store = program.TypeStore;
            factory = program.TypeFactory;
            globals = program.Globals;
			store.EnsureExpressionTypeVariable(factory, globals);

			StructureType s = new StructureType(null, 0);
			s.Fields.Add(0x00100000, PrimitiveType.Word32, null);

			TypeVariable tvGlobals = store.EnsureExpressionTypeVariable(factory, globals);
			EquivalenceClass eqGlobals = new EquivalenceClass(tvGlobals);
			eqGlobals.DataType = s;
			globals.TypeVariable.DataType = new Pointer(eqGlobals, 4);
			globals.DataType = globals.TypeVariable.DataType;

            tcr = new TypedConstantRewriter(program);
		}
开发者ID:killbug2004,项目名称:reko,代码行数:27,代码来源:TypedConstantRewriterTests.cs

示例8: Setup

		public void Setup()
		{
            mem = new MemoryArea(Address.Ptr32(0x00100000), new byte[1024]);
            var arch = new FakeArchitecture();
            this.program = new Program
            {
                Architecture = arch,
                SegmentMap = new SegmentMap(
                    mem.BaseAddress,  
                    new ImageSegment(".text", mem, AccessMode.ReadWriteExecute)),
                Platform = new DefaultPlatform(null, arch),
            };
            store = program.TypeStore;
            factory = program.TypeFactory;
            globals = program.Globals;
			store.EnsureExpressionTypeVariable(factory, globals);

			StructureType s = new StructureType(null, 0);
			s.Fields.Add(0x00100000, PrimitiveType.Word32, null);

			TypeVariable tvGlobals = store.EnsureExpressionTypeVariable(factory, globals);
			EquivalenceClass eqGlobals = new EquivalenceClass(tvGlobals);
			eqGlobals.DataType = s;
			globals.TypeVariable.DataType = new Pointer(eqGlobals, 4);
			globals.DataType = globals.TypeVariable.DataType;
		}
开发者ID:relaxar,项目名称:reko,代码行数:26,代码来源:TypedConstantRewriterTests.cs

示例9: BlockStructure

	public BlockStructure(string DefaultType) {
		if (DefaultType == "Tree") {
			MyBlocks.Size = new Vector3 (6, 9, 6);
			MyType = StructureType.Tree;
		}
		MyBlocks.InitilizeData ();
		UpdateBlockStructureWithType ();
	}
开发者ID:Deus0,项目名称:Zeltex,代码行数:8,代码来源:BlockStructure.cs

示例10: UnifyStructs

		public void UnifyStructs()
		{
            StructureType m1 = new StructureType { Fields = { { 4, PrimitiveType.Word32 } } };
            StructureType m2 = new StructureType { Fields = { { 8, PrimitiveType.Word32 } } };

			StructureType m = (StructureType) un.Unify(m1, m2);
			Assert.AreEqual(2, m.Fields.Count);
		}
开发者ID:relaxar,项目名称:reko,代码行数:8,代码来源:UnifierTests.cs

示例11: MergeStaggeredArrays2

		public void MergeStaggeredArrays2()
		{
			StructureType s = new StructureType(null, 0);
			AddArrayField(s, 0, 8, PrimitiveType.Int32);
			AddArrayField(s, 4, 8, PrimitiveType.Int32);
			trans.MergeStaggeredArrays(s);
			Assert.AreEqual("(struct (0 (arr (struct 0008 (0 int32 dw0000) (4 int32 dw0004))) a0000))", s.ToString());
		}
开发者ID:gitter-badger,项目名称:reko,代码行数:8,代码来源:TypeTransformArrayTests.cs

示例12: BuildStaggeredArrays

		private StructureType BuildStaggeredArrays()
		{
			StructureType s = new StructureType(null, 0);
			s.Fields.Add(4, new ArrayType(new StructureType(null, 20) { Fields = { { 0, PrimitiveType.Int32 } } }, 0));
			s.Fields.Add(8, new ArrayType(new StructureType(null, 20) { Fields = { { 0, PrimitiveType.Real64} } }, 0));
			s.Fields.Add(12,new ArrayType(new StructureType(null, 20) { Fields = { { 0, PrimitiveType.Byte } } }, 0));
			return s;
		}
开发者ID:gitter-badger,项目名称:reko,代码行数:8,代码来源:TypeTransformArrayTests.cs

示例13: DTS_issue_113

 public void DTS_issue_113()
 {
     // This recursive structure shoudn't blow up the stack.
     var str = new StructureType("foo", 0);
     str.Fields.Add(0, new Pointer(str, 4), "bar");
     var sStr = str.Accept(new DataTypeSerializer());
     Assert.AreEqual("struct(foo, (0, bar, ptr(struct(foo, ))))", sStr.ToString());
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:8,代码来源:DataTypeSerializerTests.cs

示例14: MergeOffsetStructures

		public void MergeOffsetStructures()
		{
			StructureType s1 = new StructureType(null, 20);
			s1.Fields.Add(0, PrimitiveType.Int32);
			StructureType s2 = new StructureType(null, 20);
			s2.Fields.Add(0, PrimitiveType.Real32);
			DataType dt = trans.MergeOffsetStructures(s1, 4, s2, 8);
			Assert.AreEqual("(struct 0014 (0 int32 dw0000) (4 real32 r0004))", dt.ToString());
		}
开发者ID:gitter-badger,项目名称:reko,代码行数:9,代码来源:TypeTransformArrayTests.cs

示例15: Structure

 public Structure(Vector2Int location, User owner, StructureType type)
 {
     _commands = new Dictionary<string, Command>();
     Squads = new List<Squad>();
     Enabled = true;
     Location = location;
     Owner = owner;
     Type = type;
 }
开发者ID:nug700,项目名称:WarWorldInfServer,代码行数:9,代码来源:Structure.cs


注:本文中的StructureType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。