本文整理汇总了C#中Equipment类的典型用法代码示例。如果您正苦于以下问题:C# Equipment类的具体用法?C# Equipment怎么用?C# Equipment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Equipment类属于命名空间,在下文中一共展示了Equipment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateInitialData
private void CreateInitialData()
{
_rootEquipment = new Equipment {Name = "Motor"};
_childEquipment1 = new Equipment {Name = "AC Motor"};
_childEquipment2 = new Equipment {Name = "DC Motor"};
_grandCildEquipment1_1 = new Equipment {Name = "AC LV Motor"};
_grandCildEquipment1_2 = new Equipment {Name = "AC MV Motor"};
_grandCildEquipment1_3 = new Equipment {Name = "AC HV Motor"};
_grandCildEquipment2_1 = new Equipment {Name = "DC LV Motor"};
_grandCildEquipment2_2 = new Equipment {Name = "DC MV Motor"};
_rootEquipment.AddChildEquipment(_childEquipment1);
_rootEquipment.AddChildEquipment(_childEquipment2);
_childEquipment1.AddChildEquipment(_grandCildEquipment1_1);
_childEquipment1.AddChildEquipment(_grandCildEquipment1_2);
_childEquipment1.AddChildEquipment(_grandCildEquipment1_3);
_childEquipment2.AddChildEquipment(_grandCildEquipment2_1);
_childEquipment2.AddChildEquipment(_grandCildEquipment2_2);
using (var session = _sessionFactory.OpenSession())
{
session.Save(_rootEquipment);
session.Flush();
}
}
示例2: Insert
///<summary>Inserts one Equipment into the database. Returns the new priKey.</summary>
internal static long Insert(Equipment equipment)
{
if(DataConnection.DBtype==DatabaseType.Oracle) {
equipment.EquipmentNum=DbHelper.GetNextOracleKey("equipment","EquipmentNum");
int loopcount=0;
while(loopcount<100){
try {
return Insert(equipment,true);
}
catch(Oracle.DataAccess.Client.OracleException ex){
if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
equipment.EquipmentNum++;
loopcount++;
}
else{
throw ex;
}
}
}
throw new ApplicationException("Insert failed. Could not generate primary key.");
}
else {
return Insert(equipment,false);
}
}
示例3: get
public static Equipment get() {
if(_instance == null) {
Logger.Log("Equipment::get was badly initialized", Logger.Level.WARN);
_instance = GameObject.Find(gameObjectName).GetComponent<Equipment>();
}
return _instance;
}
示例4: AddEquipment
public List<Equipment> AddEquipment(Equipment equipment)
{
List<Equipment> toBeRemoved = new List<Equipment>();
for(int i=0;i<equipped.Count;i++){
if(equipped[i].GetType() == equipment.GetType()){
AddToInventory(equipped[i],1);
equipped[i] = equipment;
toBeRemoved.Add(equipped[i]);
return null;
}
if(equipment is TwoHanded){
if(equipped[i] is OneHanded)
toBeRemoved.Add(equipped[i]);
}
if(equipment is OneHanded){
if(equipped[i] is TwoHanded)
toBeRemoved.Add(equipped[i]);
}
}
foreach(Equipment equip in toBeRemoved){
AddToInventory(equip,1);
equipped.Remove(equip);
}
equipped.Add(equipment);
return null;
}
示例5: Awake
//dan
//protected PlayerRotation PlayerRot;
// =============================================================================
// =============================================================================
// METHODS UNITY ---------------------------------------------------------------
protected virtual void Awake()
{
Config = GameObject.FindWithTag ( "Config" ).GetComponent<Config> ();
Trans = transform;
Audio = audio;
NetView = networkView;
GameObject player = GameObject.FindWithTag ( "Player" );
PlayerMov = player.GetComponent<PlayerMovement> ();
//dan
//TODO: fix player Rotation
//PlayerRot = player.GetComponent<PlayerRotation> ();
Equip = gameObject.GetComponent<Equipment> ();
if ( DisplayLeft )
{
DisplayLeft.renderer.material.color = DisplayColor;
}
if ( DisplayRight )
{
DisplayRight.renderer.material.color = DisplayColor;
}
}
示例6: ProcessEqu
private void ProcessEqu(Equipment sourceEquipment, int _playerId)
{
equipment = new InvItem[sourceEquipment.GetSlotCount ()];
for (int i = 0; i < sourceEquipment.GetSlotCount (); i++) {
equipment [i] = CreateInvItem (sourceEquipment.GetSlotItem (i), 1, _playerId);
}
}
示例7: AddItem
/**
* Attempt to add an item to this grid in any spot that it will fit
* Return false if no space
*/
public override bool AddItem(Equipment item)
{
InventoryGridItem gridItem = item.inventoryGridItem;
for (int i = 0; i + gridItem.width <= numTilesX; i++) {
for (int j = 0; j + gridItem.height <= numTilesY; j++) {
// If the item fits, add it to the inventory
if (CanItemFit(item.inventoryGridItem, i, j)) {
bool inserted = base.AddItem(item);
// If it was successfully added, add it to the grid
if (inserted) {
gridItem.x = i;
gridItem.y = j;
for (int k = 0; k < gridItem.width; k++)
for (int q = 0; q < gridItem.height; q++)
gridFills[gridItem.x + k, gridItem.y + q] = true;
// Auto add it to an available hotkey slot if the item is flagged to do so
if (item.inventoryGridItem.autoAddToHotkey) {
for (int q = 0; q < numHotkeys; q++) {
if (hotkeyItems[q] == null) {
hotkeyItems[q] = item;
break;
}
}
}
}
return inserted;
}
}
}
return false;
}
示例8: OnEnable
public override void OnEnable()
{
e = target as Equipment;
fdb = e.fdb;
base.OnEnable();
name = "Equipment";
}
示例9: MTBISummaryManager
public MTBISummaryManager(Equipment.EquipmentBase equipment)
{
EquipmentInstance = equipment;
AlarmList = new List<string>();
Load();
Run = true;
Thread thread = new Thread(
delegate()
{
while (Run)
{
Action log;
if (_logQueue.Count > 0)
{
lock (threadRoot)
{
log = _logQueue.Dequeue();
}
log();
}
Thread.Sleep(10);
}
});
thread.Start();
}
示例10: RemoveEquipment
public void RemoveEquipment(Equipment equipment)
{
if(equipped.Contains(equipment)){
AddToInventory(equipment,1);
equipped.Remove(equipment);
}
}
示例11: AssignAttributes
void AssignAttributes(Equipment e)
{
// Get base stat from equipment designation
//foreach (KeyValuePair<string, StatTemplate> pair in e.Designation.BaseStats) {
// var statKey = pair.Key;
// var statTemplate = pair.Value;
// float val = BaseStatValue(statKey);
// float eqTypeMultiplier = EquipmentTypeMultiplier(e.Type, statKey);
// val *= eqTypeMultiplier;
// float rarityMultiplier = RarityMultiplier(e.Rarity, Stat.SignForValue(val));
// val *= rarityMultiplier;
// // Prefix
// var prefixRoll = tpd.RollPercent(e.Rarity.prefixChance);
// if (prefixRoll) {
// e.Prefix = EquipmentModifier.Prefix();
// ApplyModifier(e, e.Prefix);
// }
// // Suffix
// var suffixRoll = tpd.RollPercent(e.Rarity.suffixChance);
// if (suffixRoll) {
// e.Suffix = EquipmentModifier.Suffix();
// ApplyModifier(e, e.Suffix);
// }
// e.Stats[statTemplate.key] = new Stat(statTemplate.key, val);
//}
}
示例12: Login
public void Login()
{
if (username.text.Trim ().Equals ("")) {
ShowHint.Hint (StringCollection.NEEDUSERNAME);
return;
}
if (password.text.Trim ().Equals ("")) {
ShowHint.Hint (StringCollection.NEEDPASSWORD);
return;
}
bool vali = false;
//去服务器验证
vali = true;
//如果成功
if (vali) {
bool haveInfo = true;
if (haveInfo) {
//如果有玩家信息,加载并跳转城市场景
//从服务器端获取玩家数据初始化
gData.isPlayer = false; //初始的时候总是佣兵模式,玩家在线后与其他玩家组队,才会变成联机模式
gData.characterList = new List<Character> ();
Equipment e = new Equipment (1, 2, 0, 0, Equipment.EquipPos.BODY, "2", "学者的思考", 1, 200);
List<Equipment> eList = new List<Equipment> ();
eList.Add (e);
Character c = new Character (2000, 30, 100, 0, 0, "zhouhui", true, 50, 0, ProFactory.getPro ("Geomancer", "1"), 10, 0, eList, -1);
HealthItem item = new HealthItem (Item.RangeType.SINGLE, 10, "1", "单体治疗药剂", 50);
List<Baggrid> bgList = new List<Baggrid> ();
Baggrid bg = new Baggrid (item, 2);
bgList.Add (bg);
// Equipment e2 = new Equipment(2,3,Equipment.EquipPos.BODY,"3","学者的幻想",1,500);
// Baggrid bg2 = new Baggrid (e2, 1);
// bgList.Add (bg2);
c.BgList = bgList;
gData.characterList.Add (c);
Character c2 = new Character (0, 40, 100, 0, 0, "unity", false, 100, 100, ProFactory.getPro ("Settler", "1"), 1, 0, null, -1);
gData.characterList.Add (c2);
Application.LoadLevel ("city");
} else {
//如果没有,跳转角色创建场景
Application.LoadLevel ("create");
}
} else {
ShowHint.Hint (StringCollection.INVALIDACCOUNT);
}
}
示例13: Initialize
public void Initialize(Equipment.DependencyEquipments.TrayLoadingUnit unit)
{
UIUtility.SetActionsOfGeneralPartToButton(buttonClamp, unit.LeftTrayClamp, "EXTEND", "RETRACT");
UIUtility.SetActionsOfGeneralPartToButton(buttonFirstLifter, unit.FirstTrayLifter, "UP", "DOWN");
UIUtility.SetActionsOfGeneralPartToButton(buttonSecondLifter, unit.SecondTrayLifter, "UP", "DOWN");
UIUtility.SetActionsOfGeneralPartToButton(buttonTraySeperator, unit.FrontLeftTraySeperator , "UP", "DOWN");
UIUtility.SetActionsOfOneWayMotorPartToButton(buttonConveyor, unit.Conveyor);
}
示例14: LoadContent
public override void LoadContent(Equipment owner, ContentManager content, ManagerMap managerMap, ManagerCamera managerCamera, Entities entities)
{
base.LoadContent(owner, content, managerMap, managerCamera,entities);
AddComponent(new Sprite(ManagerContent.LoadTexture("sword"), 16, 16, new Vector2(0, 0)));
AddComponent(new Animation(16,16,2,100));
AddComponent(new Camera(managerCamera));
GuiTexture = ManagerContent.LoadTexture("sword_gui");
}
示例15: LoadContent
public override void LoadContent(Equipment owner, ContentManager content, ManagerMap managerMap, ManagerCamera managerCamera, Entities entities)
{
base.LoadContent(owner,content,managerMap,managerCamera,entities);
AddComponent(new Sprite(content.Load<Texture2D>("boomerang"),16,16,new Vector2(0,0)));
AddComponent(new Collision(managerMap,entities));
AddComponent(new Animation(16,16,3));
AddComponent(new Camera(managerCamera));
GuiTexture = content.Load<Texture2D>("boomerang_gui");
}