Example #1
0
 public BaseEquipment(Dictionary<string, string> itemDictionary)
     : base(itemDictionary)
 {
     subType = (EquipmentType)Enum.Parse(typeof(EquipmentType), itemDictionary["SubType"]);
     Stats = new EquipmentStatCollection();
     Stats.AddStat<LinkableStat>(StatType.ARMOR, int.Parse(itemDictionary["BaseStat1"]));
 }
Example #2
0
 public BaseEquipment(BaseItem item)
     : base(item)
 {
     subType = ((BaseEquipment)item).subType;
     Stats = new EquipmentStatCollection();
     Stats.AddStat<LinkableStat>(StatType.ARMOR, item.Stats.GetStat(StatType.ARMOR).BaseValue);
 }
Example #3
0
 public virtual bool IsOnLine(EquipmentType equipmentType)
 {
     // если устройство хардварное - спрашиваем у контроллера
     if (equipmentType.IsHardware)
         return _controller.IsOnLine(equipmentType.UID);
     return true;
 }
Example #4
0
        public void GetDevices(EquipmentType equipmentType, string title = "")
        {
            EquipmentList.Clear();
            using (StructureMap.IContainer c = NestedContainer)
            {
                var equipments =
                    Using<IEquipmentRepository>(c).GetAll().Where(p => p.EquipmentType == equipmentType).ToList();
                foreach (var equipment in equipments)
                {
                    EquipmentList.Add(new Equipment(equipment.Id)
                                          {
                                              Code = equipment.Code,
                                              EquipmentNumber = equipment.EquipmentNumber,
                                              Description = equipment.Description,
                                              EquipmentType = equipment.EquipmentType,
                                              Model = equipment.Make,
                                              CostCentre = equipment.CostCentre,
                                              Name = equipment.Name,
                                              _Status = equipment._Status,
                                              _DateCreated = equipment._DateCreated,
                                              _DateLastUpdated = equipment._DateLastUpdated

                                          });
                }
            }
        }
Example #5
0
 public Equipment(EquipmentType type, int price, TechLevel minTechLevel, int chance)
 {
     _equipType = type;
     _price = price;
     _minTech = minTechLevel;
     _chance = chance;
 }
Example #6
0
 public Equipment(Hashtable hash) : base(hash)
 {
     _equipType = (EquipmentType)GetValueFromHash(hash, "_equipType");
     _price = (int)GetValueFromHash(hash, "_price");
     _minTech = (TechLevel)GetValueFromHash(hash, "_minTech");
     _chance = (int)GetValueFromHash(hash, "_chance");
 }
Example #7
0
		void SetCategory (EquipmentType category) {

			if (category != currentCategory){
				PopulateList ( category);
				currentCategory = category;
			}

		}
Example #8
0
    public Equipment Generate(EquipmentType type)
    {
        var e = new Equipment();
        e.Type = type;
        e.SlotType = type.PrimarySlotType;
        e.Name = type.Name;
        var rarityGen = new RarityGenerator(sim);
        e.Rarity = rarityGen.Roll();
        AssignAttributes(e);

        return e;
    }
Example #9
0
 public IEnumerable<string> Get(EquipmentType type)
 {
     List<string> items = new List<string>();
     foreach (EquipmentData item in Equipments.Keys)
     {
         if (item.Type == type )
         {
             items.Add(item.Name);
         }
     }
     return items;
 }
 public bool IsOnLine(EquipmentType equipmentType)
 {
     if (equipmentType.UID == Constants.ControllerUID)
         //опрос контроллера
         return IsControllerOnLine;
     IModule module;
     if (mappingList.TryGetValue(equipmentType.GetType(), out module))
     {
         return module.ServerModule.IsOnLine(equipmentType);
     }
     return false;
 }
    public void initEquipableItem(Sprite sprite, string itemTitle, string itemDescription, double cost, double weight, int rarity,
	                              float attackMultiplier, float defenseMultiplier, float magicMultiplier, float resistanceMultiplier, float healthMultiplier, float manaMultiplier, 
	                              float attack, float defense, float magic, float resistance, float health, float mana, 
	                               EquipmentType equipmentType, WeaponType weaponType, ArmorType armorType)
    {
        base.init(sprite, itemTitle, itemDescription, cost, weight, rarity,
                  attackMultiplier, defenseMultiplier, magicMultiplier, resistanceMultiplier, healthMultiplier, manaMultiplier,
                  attack, defense, magic, resistance, health, mana);

        this.equipmentType = equipmentType;
        this.weaponType = weaponType;
        this.armorType = armorType;
    }
 public CommonDocumentEquipmentModel(QuickPipe quickObject, EquipmentType equipmentType, int documentId = 0)
 {
     EquipmentId = quickObject.Id;
     DocumentId = documentId;
     Name = quickObject.Name;
     Description = quickObject.Description;
     EquipmentType = equipmentType;
     //EquipmentSubTypeId = quickObject.ClassId;
     IsActive = quickObject.IsActive;
     //Manufacturers = quickObject.Manufacturer;
     //Models = quickObject.Model;
     MaintSystemId = string.Empty; //Pipe doent have MaintSystemId property
 }
 public CommonDocumentEquipmentModel(QuickInstrument quickObject, EquipmentType equipmentType, int documentId = 0)
 {
     EquipmentId = quickObject.Id;
     DocumentId = documentId;
     Name = quickObject.Name;
     Description = quickObject.Description;
     EquipmentType = equipmentType;
     //EquipmentSubTypeId = quickObject.InstrumentTypeId;
     IsActive = quickObject.IsActive;
     //Manufacturers = quickObject.Manufacturer;
     //Models = quickObject.Model;
     //MaintSystemId = quickObject.MaintSystemId;
 }
Example #14
0
    public static GameItem generateEquipment(EquipmentType equip)
    {
        GameItem _itm = new GameItem();
        _itm.type = ItemType.Equipment;
        _itm.equipmentType = equip;
        _itm.setAttributes("equipment", "description", 9, 100);
        _itm.attributes.SetAttributes(4, 4, 4, 4, 4, 44, 0);

        _itm.special = new GameSkill();
        _itm.special.SetAttributes("special skill", "description", 15, TargetTypes.Enemy, TargetAttribute.Life);

        return _itm;
    }
Example #15
0
        public ICsvImporter GetImporter(EquipmentType equipmentType)
        {
            ICsvImporter importer;

            switch (equipmentType)
            {
                case EquipmentType.Vessel:
                    importer = new VesselCsvImporter(_backendDataContextFactory);
                    break;
                default:
                    throw new ApplicationException(equipmentType + " is not supported for CSV import.");
            }

            return importer;
        }
	public void SetEquipment(EquipmentType type,string res,Color c,MasterShop.param data)
    {
		
		if (EquipmentType.Hand == type)
		{
			switch(data.gread){
			case 0://撫でる
				GameObject.FindGameObjectWithTag("Player").GetComponent<EggStatus>().Hot+=data.hot;
				break;
			case 1://つく
				GameObject.FindGameObjectWithTag("Player").GetComponent<EggStatus>().Stres+=data.stress;
				break;
			case 2://割る
				GameObject.FindGameObjectWithTag("Player").GetComponent<EggStatus>().EggHP-=1;
                EffectCreater.CreateShockwave(EquipmentPointSystem.Get.HandPoint);
				break;
			}
        }
        if (EquipmentType.Lag == type)
        {
            GameObject g = Instantiate(GameManager.Get.Resource.GetPrefab(res)) as GameObject;
            g.transform.localScale = new Vector3(0, 1, 1);
            g.GetComponent<Image>().color = c;
            g.transform.SetParent(EquipmentPointSystem.Get.LagPiont, false);
            g.GetComponent<Equipment>().SetParam(data);
            LeanTween.scaleX(g, 1, 0.2f);

        }
        if (EquipmentType.Light == type)
        {
            //ライトの処理
            GameObject g = Instantiate(GameManager.Get.Resource.GetPrefab(res)) as GameObject;
            Vector2 pos = g.transform.localPosition;
            g.transform.localPosition = g.transform.localPosition + new Vector3(-200, 0,0);
            g.GetComponent<Image>().color = c;
            g.transform.SetParent(EquipmentPointSystem.Get.LightPoint, false);
            g.GetComponent<Equipment>().SetParam(data);
            LeanTween.moveLocal(g, pos, 0.2f);
        }
        if(EquipmentType.Drag== type)
        {
            //ドラッグの処理
            EggStatus states = GameObject.FindGameObjectWithTag("Player").GetComponent<EggStatus>();
            EffectCreater.CreateStrokeEffect2(EquipmentPointSystem.Get.HandPoint);
            states.Hot += data.hot;
            states.Stres += data.stress;
        }
    }
 void Instance_OnEquipmentStateChanged(EquipmentType equipmentType, bool? isOnLine)
 {
     bool needRefresh = false;
     foreach(var cat in _categories)
         foreach (var src in cat.Value)
         {
             if ((src.Value as Source).Type.Equals(equipmentType))
                 if (isOnLine != _states[cat.Key][src.Key])
                 {
                     needRefresh = true;
                     _states[cat.Key][src.Key] = isOnLine;
                 }
         }
     if (needRefresh && OnSourcesChanged != null)
         OnSourcesChanged();
 }
Example #18
0
        public KeyValuePair<AttributeCode, float> RandomAttribute; // 随机属性(单条)

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 类型:方法
        /// 名称:Equipment
        /// 作者:taixihuase
        /// 作用:通过数据库中获得的数据构造实例,只能由子类调用
        /// 编写日期:2015/8/16
        /// </summary>
        /// <param name="fixed"></param>
        /// <param name="allocated"></param>
        /// <param name="name"></param>
        /// <param name="occupation"></param>
        /// <param name="limit"></param>
        /// <param name="upgrade"></param>
        /// <param name="cur"></param>
        /// <param name="durability"></param>
        /// <param name="type"></param>
        protected Equipment(int @fixed, int allocated, string name, OccupationCode occupation, int limit, bool upgrade,
            int cur, int durability, EquipmentType type)
        {
            FixedId = @fixed;
            AllocatedId = allocated;
            Name = name;
            Occupation = (byte) occupation;
            LevelLimit = limit;
            IsCanUpgrade = upgrade;
            CurrentLevel = cur;
            Durability = durability;
            IsUsing = false;
            EquipType = type;
            FixedAttributes = new Dictionary<AttributeCode, float>(new EnumComparer<AttributeCode>())
            {
                {AttributeCode.Null, 0}
            };
            RandomAttribute = new KeyValuePair<AttributeCode, float>(AttributeCode.Null, 0);
        }
Example #19
0
        public static string getEquipmentTypeString(EquipmentType equipmentType)
        {
            switch(equipmentType)
            {
                case EquipmentType.All:
                     return "装备";
                case EquipmentType.MainGun:
                     return "主炮";
                case EquipmentType.ViceGun:
                     return "副炮";
                case EquipmentType.Torpedo:
                     return "鱼雷";
                case EquipmentType.AttackPlane:
                     return "攻击机";
                case EquipmentType.FightPlane:
                     return "战斗机";
                case EquipmentType.XAttackPlane:
                     return "轰炸机";
                case EquipmentType.SpyPlane:
                     return "侦察机";
                case EquipmentType.ElectricDetec:
                     return "雷达";
                case EquipmentType.StrengthenComp:
                     return "强化部件";
                case EquipmentType.Bullet:
                     return "炮弹";
                case EquipmentType.AirGun:
                     return "防空炮";
                case EquipmentType.SpecialSubmarin:
                     return "特殊潜艇";
                case EquipmentType.RepairMan:
                     return "修理员";
                case EquipmentType.AntiSubmarinComp:
                     return "反潜装备";
                default:
                     return "全部";

            }
        }
Example #20
0
        public void Populate(List<WeaponData> list , string currentlyEquipeed , EquipmentType type)
        {
            if (list.Count <= 1)
                return;

            Destroy (itemsContainer.transform.GetChild(0).gameObject );

            if (type == EquipmentType.Primary ||
                type == EquipmentType.Special ||
                type == EquipmentType.Tossable ) {

                foreach (WeaponData wi in list) {

                    if (wi.id != currentlyEquipeed) {

                        if (equippentTypeButton.equippedItems.playerInventory.Contains(wi.id)) {
                            GameObject go = (GameObject)Instantiate (itemPref);
                            go.transform.SetParent (itemsContainer.transform, false);

                            var menuItem = go.GetComponent<MenuItemSelector>();

                            icon = iconsPref.transform.Find (wi.id).GetComponent<Image>().sprite;

                            menuItem.SetItem (wi.name , wi.id , icon );
                            menuItem.OnMenuItemSelected += SetItem;
                        }

                    }
                }
            }

            if (type == EquipmentType.Character) {

            }

            if (type == EquipmentType.JetPack) {

            }
        }
        public static Equipment GetAvailableEquipmentForRent(IUnitOfWork uow, EquipmentType type, int[] excludeEquipments)
        {
            Nomenclature nomenclatureAlias = null;

            //Ищем сначала дежурные
            var proposedList = AvailableOnDutyEquipmentQuery().GetExecutableQueryOver(uow.Session)
                .JoinAlias(e => e.Nomenclature, () => nomenclatureAlias)
                .Where(() => nomenclatureAlias.Type == type)
                .List();

            var result = FirstNotExcludedEquipment(proposedList, excludeEquipments);

            if (result != null)
                return result;

            //Выбираем сначала приоритетные модели
            proposedList = AvailableEquipmentQuery().GetExecutableQueryOver(uow.Session)
                .JoinAlias(e => e.Nomenclature, () => nomenclatureAlias)
                .Where(() => nomenclatureAlias.Type == type)
                .Where(() => nomenclatureAlias.RentPriority == true)
                .List();

            result = FirstNotExcludedEquipment(proposedList, excludeEquipments);

            if (result != null)
                return result;

            //Выбираем любой куллер
            proposedList = AvailableEquipmentQuery().GetExecutableQueryOver(uow.Session)
                .JoinAlias(e => e.Nomenclature, () => nomenclatureAlias)
                .Where(() => nomenclatureAlias.Type == type)
                .List();

            result = FirstNotExcludedEquipment(proposedList, excludeEquipments);

            return result;
        }
Example #22
0
 public static void Cache(JSONNode json)
 {
     var equipmentType = new EquipmentType(json);
     all[equipmentType.Key] = equipmentType;
     Debug.Log("Loaded equipment type " + equipmentType.Name);
 }
Example #23
0
 public void EquipmentStateChange(EquipmentType equipmentType, bool isOnLine)
 {
     try
     {
         if (OnEquipmentStateChanged != null)
             OnEquipmentStateChanged(equipmentType, isOnLine);
     }
     catch (Exception ex)
     {
         _config.EventLog.WriteError(string.Format("ShowNotifier.EquipmentStateChange: {0}", ex));
     }
 }
Example #24
0
        protected override void ProcessInternal(CustomBinaryReader reader, XmlWriter writer)
        {
            type=(EquipmentType) reader.ReadByte();
            issuingMemberState=reader.ReadByte();
            driverIdentification=reader.ReadString(14);
            replacementIndex=reader.ReadByte();
            renewalIndex=reader.ReadByte();

            writer.WriteAttributeString("Type", type.ToString());
            writer.WriteAttributeString("IssuingMemberState", issuingMemberState.ToString());
            writer.WriteAttributeString("ReplacementIndex", replacementIndex.ToString());
            writer.WriteAttributeString("RenewalIndex", renewalIndex.ToString());

            writer.WriteString(driverIdentification);
        }
 public void SetFilterType(EquipmentType type)
 {
     this.type = type;
     this.localtk2d.SetKey("Equip" + ((int) type));
 }
Example #26
0
 public void ShowEquipment(EquipmentType type)
 {
     RemoveAllItens();
     for (int i = 0; i < GlobalItens.inventory.Count; i++)
     {
         GameItem itm = GlobalItens.inventory[i] as GameItem;
         if (itm.type == ItemType.Equipment && itm.equipmentType == type)
         {
             addItem(itm);
         }
     }
 }
Example #27
0
 public EqiupmentStateChangeEventArgs(EquipmentType equipmentType, bool isOnLine)
 {
     _isOnLine = isOnLine;
     _equipmentType = equipmentType;
 }
        private void LoadDisciplines()
        {
            CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);

            cmsWebServiceClient.GetEquipmentTypesCompleted += (sender, e) =>
                {
                    if (e != null && e.Result.Count > 0)
                    {
                        EquipmentType all = new EquipmentType {Name = ALL, Code = ALL};
                        e.Result.Insert(0, all);

                        Disciplines = new ObservableCollection<EquipmentType>(e.Result);

                        SelectedDiscipline = all;

                        RaisePropertyChanged("Disciplines");
                        RaisePropertyChanged("SelectedDiscipline");

                        //now safe to load other cached data...
                        SetEquipmentsCache();
                    }
                };
            cmsWebServiceClient.GetEquipmentTypesAsync();
        }
Example #29
0
 void Instance_OnEquipmentStateChanged(EquipmentType equipmentType, bool? isOnLine)
 {
     //https://sentinel2.luxoft.com/sen/issues/browse/PMEDIAINFOVISDEV-997
     Display disp = this.Displays.Where(x => x.Type.Equals(equipmentType)/*x => x.Type.GetType() == equipmentType.GetType()*/).FirstOrDefault();
     if (OnDisplayStateChanged != null && disp != null)
         OnDisplayStateChanged(disp, isOnLine);
 }
	public void SetEquipment(EquipmentType type,string res,Color c,MasterCharacter.Cell data)
	{
		
	}
Example #31
0
 public EquipmentType AddNewType(EquipmentType type) => _equipmentTypeRepository.Create(type);