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


C# Equipment类代码示例

本文整理汇总了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();
            }
        }
开发者ID:tasluk,项目名称:hibernatingrhinos,代码行数:25,代码来源:EquipmentRepository_Fixture.cs

示例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);
     }
 }
开发者ID:nampn,项目名称:ODental,代码行数:26,代码来源:EquipmentCrud.cs

示例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;
 }
开发者ID:CyberCRI,项目名称:Hero.Coli,代码行数:7,代码来源:Equipment.cs

示例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;
 }
开发者ID:hitnoodle,项目名称:TGK-RPG,代码行数:26,代码来源:FighterInventory.cs

示例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;
        }
    }
开发者ID:Jonas90,项目名称:iss,代码行数:30,代码来源:MeterAbstract.cs

示例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);
     }
 }
开发者ID:Ketchu13,项目名称:7dtd_Server-Fixes,代码行数:7,代码来源:Inventory.cs

示例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;
 }
开发者ID:peterwerner,项目名称:unity_fps_rpg,代码行数:35,代码来源:InventoryGrid.cs

示例8: OnEnable

 public override void OnEnable()
 {
     e = target as Equipment;
     fdb = e.fdb;
     base.OnEnable();
     name = "Equipment";
 }
开发者ID:JoeOsborn,项目名称:SRPGCK,代码行数:7,代码来源:EquipmentEditor.cs

示例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();
        }
开发者ID:vesteksoftware,项目名称:VT5081-SSD,代码行数:31,代码来源:MTBISummaryManager.cs

示例10: RemoveEquipment

 public void RemoveEquipment(Equipment equipment)
 {
     if(equipped.Contains(equipment)){
         AddToInventory(equipment,1);
         equipped.Remove(equipment);
     }
 }
开发者ID:hitnoodle,项目名称:TGK-RPG,代码行数:7,代码来源:FighterInventory.cs

示例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);
        //}
    }
开发者ID:britg,项目名称:ptq,代码行数:32,代码来源:EquipmentGenerator.cs

示例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);
        }
    }
开发者ID:OneChance,项目名称:TombAdventure,代码行数:59,代码来源:UI_Login.cs

示例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);
 }
开发者ID:vesteksoftware,项目名称:VT5025,代码行数:8,代码来源:PageTrayLoader.xaml.cs

示例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");
 }
开发者ID:cquinterom,项目名称:SpeedCodingZelda,代码行数:8,代码来源:Sword.cs

示例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");
 }
开发者ID:noogai03sprojects,项目名称:SpeedCodingZelda,代码行数:9,代码来源:Boomerang.cs


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