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


C# MaterialType类代码示例

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


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

示例1: CosntructionRequestCantBeNull

        public void CosntructionRequestCantBeNull()
        {
            var offer = new MaterialType[] { MaterialType.Brick };
            var player = new Mock<IPlayer>();

            Assert.Throws<ArgumentNullException>(() => new Trade(offer, null, player.Object));
        }
开发者ID:Corne,项目名称:VOC,代码行数:7,代码来源:TradeTest.cs

示例2: ConstructionOfferCantBeNull

        public void ConstructionOfferCantBeNull()
        {
            var request = new MaterialType[] { MaterialType.Brick };
            var player = new Mock<IPlayer>();

            Assert.Throws<ArgumentNullException>(() => new Trade(null, request, player.Object));
        }
开发者ID:Corne,项目名称:VOC,代码行数:7,代码来源:TradeTest.cs

示例3: ConstructionPlayerCantBeNull

        public void ConstructionPlayerCantBeNull()
        {
            var request = new MaterialType[] { MaterialType.Lumber };
            var offer = new MaterialType[] { MaterialType.Wool };

            Assert.Throws<ArgumentNullException>(() => new Trade(offer, request, null));
        }
开发者ID:Corne,项目名称:VOC,代码行数:7,代码来源:TradeTest.cs

示例4: Create

 public static Material Create(string description, MaterialType type, HttpPostedFileBase file, BaseDbContext db)
 {
     if (!type.Match(file))
         return null;
     string uploadFileName = DateTime.Now.ToString("yyyyMMddHHmmss") + Path.GetExtension(file.FileName);
     string absolutFileName;
     switch (type)
     {
         case MaterialType.Identity:
             absolutFileName = HttpContext.Current.Server.MapPath("~/UserUpload/") + "Identity/" + uploadFileName;
             break;
         case MaterialType.Avatar:
             absolutFileName = HttpContext.Current.Server.MapPath("~/UserUpload/") + "Avatar/" + uploadFileName;
             break;
         default:
             absolutFileName = HttpContext.Current.Server.MapPath("~/UserUpload/") + "Administrator/" + uploadFileName;
             break;
     }
     //执行上传
     if (File.Exists(absolutFileName))
     {
         File.Delete(absolutFileName);
     }
     file.SaveAs(absolutFileName);
     Material material = new Material(uploadFileName, description, type);
     //添加Material记录
     db.Materials.Add(material);
     //保存更改
     db.SaveChanges();
     return db.Materials.Find(material.Id);
 }
开发者ID:Pyuuma,项目名称:SITE,代码行数:31,代码来源:MaterialModels.cs

示例5: Tile

 public Tile(int x, int y, int number, MaterialType material)
 {
     X = x;
     Y = y;
     Number = number;
     Rawmaterial = material;
 }
开发者ID:Corne,项目名称:VOC,代码行数:7,代码来源:Tile.cs

示例6: FarmTest

        public void FarmTest(MaterialType type)
        {
            var tile = new Tile(1, 2, 3, type);
            IRawMaterial material = tile.Farm();

            Assert.Equal(type, material.Type);
        }
开发者ID:Corne,项目名称:VOC,代码行数:7,代码来源:TileTest.cs

示例7: Table

 public Table(string model, MaterialType initialMaterial, decimal price, decimal height, 
     decimal initalLength, decimal initialWidth)
     : base(model, initialMaterial, price, height)
 {
     this.Length = initalLength;
     this.Width = initialWidth;
 }
开发者ID:Borayvor,项目名称:TelerikAcademy,代码行数:7,代码来源:Table.cs

示例8: Furniture

 public Furniture(string initialModel, MaterialType initialMaterialType, decimal initialPrice, decimal initialHeight)
 {
     this.Model = initialModel;
     this.materialType = initialMaterialType;
     this.Price = initialPrice;
     this.Height = initialHeight;
 }
开发者ID:IvanPanchev,项目名称:TelerikAcademy,代码行数:7,代码来源:Furniture.cs

示例9: fillSchemesMap

	public static void fillSchemesMap () {
		schemesMaterials = new Dictionary<WorkbenchSchemeType, MaterialType[]>();

		MaterialType[] materials = new MaterialType[2];
		materials[0] = MaterialType.STEEL_BAR;
		materials[1] = MaterialType.WOOD_STICK;
		schemesMaterials.Add(WorkbenchSchemeType.IRON_DAGGER, materials);

		materials = new MaterialType[3];
		materials[0] = MaterialType.STEEL_BAR;
		materials[1] = MaterialType.STEEL_BAR;
		materials[2] = MaterialType.WOOD_STICK;
		schemesMaterials.Add(WorkbenchSchemeType.IRON_SWORD, materials);

		materials = new MaterialType[3];
		materials[0] = MaterialType.STEEL_BAR;
		materials[1] = MaterialType.WOOD_STICK;
		materials[2] = MaterialType.WOOD_STICK;
		schemesMaterials.Add(WorkbenchSchemeType.IRON_AXE, materials);

		materials = new MaterialType[4];
		materials[0] = MaterialType.STEEL_BAR;
		materials[1] = MaterialType.STEEL_BAR;
		materials[2] = MaterialType.STEEL_BAR;
		materials[3] = MaterialType.STEEL_BAR;
		schemesMaterials.Add(WorkbenchSchemeType.STEEL_ARMOR, materials);
	}
开发者ID:aintech,项目名称:Heroes_of_Routine,代码行数:27,代码来源:WorkbenchSchemeType.cs

示例10: Furniture

 protected Furniture(string model, decimal price, decimal height, MaterialType material)
 {
     this.Model = model;
     this.Price = price;
     this.Height = height;
     this.material = material;
 }
开发者ID:reminchev,项目名称:SoftUni-Projects,代码行数:7,代码来源:Furniture.cs

示例11: ETool

 public ETool()
 {
     _processSpd = 0.0f;
     _swingType = SwingType.Dig;
     _materialType = MaterialType.Wood;
     _maxRange = 0;
 }
开发者ID:chozandrias76,项目名称:Pangolin-Source-Code,代码行数:7,代码来源:ETool.cs

示例12: Furniture

 protected Furniture(string model, MaterialType type, decimal price, decimal height)
 {
     this.Model = model;
     this._type = type;
     this.Price = price;
     this.Height = height;
 }
开发者ID:dhristoskov,项目名称:HighQualityCode,代码行数:7,代码来源:Furniture.cs

示例13: Table

 public Table(string model, MaterialType material, decimal price, decimal height, decimal length, decimal width) 
     : base(model, material, price, height)
 {
     this.width = width;
     this.length = length;
     this.Area = this.Length*this.Width;
 }
开发者ID:StanislavBozhilov,项目名称:SoftwareUniversity,代码行数:7,代码来源:Table.cs

示例14: ConstructionCantTradeSeaAndDessert

        public void ConstructionCantTradeSeaAndDessert(MaterialType[] request, MaterialType[] offer)
        {
            var player = new Mock<IPlayer>();

            Assert.Throws<ArgumentException>(() => new Trade(offer, request, player.Object));

        }
开发者ID:Corne,项目名称:VOC,代码行数:7,代码来源:TradeTest.cs

示例15: Furniture

 public Furniture(string model, MaterialType materialType, decimal price, decimal height)
 {
     this.Model = model;
     this.Price = price;
     this.material = materialType;
     this.height = height;
 }
开发者ID:alex687,项目名称:SoftUni-Homeworks,代码行数:7,代码来源:Furniture.cs


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