本文整理汇总了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));
}
示例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));
}
示例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));
}
示例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);
}
示例5: Tile
public Tile(int x, int y, int number, MaterialType material)
{
X = x;
Y = y;
Number = number;
Rawmaterial = material;
}
示例6: FarmTest
public void FarmTest(MaterialType type)
{
var tile = new Tile(1, 2, 3, type);
IRawMaterial material = tile.Farm();
Assert.Equal(type, material.Type);
}
示例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;
}
示例8: Furniture
public Furniture(string initialModel, MaterialType initialMaterialType, decimal initialPrice, decimal initialHeight)
{
this.Model = initialModel;
this.materialType = initialMaterialType;
this.Price = initialPrice;
this.Height = initialHeight;
}
示例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);
}
示例10: Furniture
protected Furniture(string model, decimal price, decimal height, MaterialType material)
{
this.Model = model;
this.Price = price;
this.Height = height;
this.material = material;
}
示例11: ETool
public ETool()
{
_processSpd = 0.0f;
_swingType = SwingType.Dig;
_materialType = MaterialType.Wood;
_maxRange = 0;
}
示例12: Furniture
protected Furniture(string model, MaterialType type, decimal price, decimal height)
{
this.Model = model;
this._type = type;
this.Price = price;
this.Height = height;
}
示例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;
}
示例14: ConstructionCantTradeSeaAndDessert
public void ConstructionCantTradeSeaAndDessert(MaterialType[] request, MaterialType[] offer)
{
var player = new Mock<IPlayer>();
Assert.Throws<ArgumentException>(() => new Trade(offer, request, player.Object));
}
示例15: Furniture
public Furniture(string model, MaterialType materialType, decimal price, decimal height)
{
this.Model = model;
this.Price = price;
this.material = materialType;
this.height = height;
}