Ejemplo n.º 1
0
 public CartController(IMessageSession _messageSession)
 {
     _domainInterface = new DomainInterface(_messageSession);
     _modelSpec       = new EnglishDictionary();
     _equipment       = EquipmentCollection.FromSampleFile(_modelSpec);
     _invoiceSpec     = new EnglishInvoice();
 }
Ejemplo n.º 2
0
        public EquipmentCollection GetAllEquipments(int PageSize, int PageIndex, string SortField, bool DESC, out int retCnt)
        {
            EquipmentCollection retobjs = null;
            string _DESC = "DESC";

            if (DESC)
            {
                _DESC = "DESC";
            }
            else
            {
                _DESC = "ASC";
            }

            string sql = "select * from " + this.m_equipmentTablename
                         + " order by " + SortField + " " + _DESC;

            retobjs = this._getEquipments(sql, PageIndex, PageSize);
            //try
            //{
            sql    = sql.Replace("*", "count(*)");
            sql    = sql.Replace("order", "");
            sql    = sql.Replace("by", "");
            sql    = sql.Replace(_DESC, "");
            sql    = sql.Replace(SortField, "");
            retCnt = this.m_db.GetRecordCount(sql);
            //}
            //catch
            //{
            retCnt = 0;
            //}
            return(retobjs);
        }
Ejemplo n.º 3
0
        public static EquipmentCollection GetEquipmentCollection(string deptId, string equipmentCode, string equipmentName, string equipmentType)
        {
            EquipmentCollection equipments = new EquipmentCollection();
            string sqlWhere = "";

            sqlWhere = "(State=1)";
            if (deptId.ToString() != "")
            {
                sqlWhere = sqlWhere + " and (LocateDeptID = " + deptId + ") ";
            }
            if (equipmentCode.Trim() != "")
            {
                sqlWhere = sqlWhere + " and (EquipmentManualCode like '%" + equipmentCode.Trim() + "%') ";
            }
            if (equipmentName.Trim() != "")
            {
                sqlWhere = sqlWhere + " and (EquipmentName like '%" + equipmentName.Trim() + "%') ";
            }
            if (equipmentType.Trim() != "")
            {
                sqlWhere = sqlWhere + " and (EquipmentType='" + equipmentType + "') ";
            }
            using (DataTable table = publicDbOpClass.GetPageData(sqlWhere, "Ent_Ept_Equipments", "NoteSequenceID desc"))
            {
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    equipments.Add(GetEquipmentInfoFromDataRow(table.Rows[i]));
                }
            }
            return(equipments);
        }
Ejemplo n.º 4
0
        public EquipmentCollection GetAllEquipments()
        {
            EquipmentCollection equipments = null;

            if (this.TryConnection())
            {
                DatabaseParameters keyParameters = new DatabaseParameters();
                DataTable          table         = this.QueryData(keyParameters, this.DataStructrure.Tables.MasterEquipment.ActualTableName);
                if (table == null)
                {
                    return(equipments);
                }
                equipments = new EquipmentCollection();
                foreach (DataRow row in table.Rows)
                {
                    EquipmentObj obj2 = new EquipmentObj(row[this.DataStructrure.Tables.MasterEquipment.EquipmentID.ActualFieldName].ToString())
                    {
                        Description        = row[this.DataStructrure.Tables.MasterEquipment.EquipmentDescription.ActualFieldName].ToString(),
                        EquipmentObject    = row[this.DataStructrure.Tables.MasterEquipment.EquipmentObject.ActualFieldName].ToString(),
                        EquipmentSNR       = row[this.DataStructrure.Tables.MasterEquipment.Equipmentsnr.ActualFieldName].ToString(),
                        EquipmentLocation  = row[this.DataStructrure.Tables.MasterEquipment.EquipmentLocation.ActualFieldName].ToString(),
                        EquipmentProfileID = row[this.DataStructrure.Tables.MasterEquipment.EquipmentProfile.ActualFieldName].ToString()
                    };
                    equipments.Add(obj2);
                }
            }
            return(equipments);
        }
    public void Equip(OnItemEquipEventData e)
    {
        EquipmentCollection equipment = e.Equipper
                                        .GetComponentInChildren <EquipmentCollection>();

        //add item to slot
        equipment.AddItemToSlot(e.EquipmentSlot, e.Item);
    }
Ejemplo n.º 6
0
 /// <summary>
 /// Creates a new unit
 /// </summary>
 /// <param name="name">The name of the unit</param>
 public Unit(string name)
     : base(name)
 {
     Stats = new Stats(this);
     _equipment = new EquipmentCollection(this);
     Experience.Value = new Experience();
     Name.Value = name;
 }
Ejemplo n.º 7
0
        public EquipmentCollection GetEquipment()
        {
            EquipmentCollection ec = new EquipmentCollection();
            APIGetJSONAsync <List <Equipment> > getEquipment = new APIGetJSONAsync <List <Equipment> >(this._fullservicepath + "ConcertEquipments");

            ec.equipments = getEquipment.data;
            return(ec);
        }
    public void Unequip(OnItemUnequipEventData e)
    {
        EquipmentCollection equipment = e.Equipper
                                        .GetComponentInChildren <EquipmentCollection>();

        if (equipment.IsItemInSlot(e.EquipmentSlot))
        {
            equipment.RemoveItemInSlot(e.EquipmentSlot);
        }
    }
Ejemplo n.º 9
0
        private static Cart ReadCart(
            HttpRequest request, EquipmentCollection equipment, ModelSpec spec)
        {
            List <CartCompactItem> items = new List <CartCompactItem>();
            var cartCookie = request.Cookies["cart"];

            if (!string.IsNullOrWhiteSpace(cartCookie))
            {
                items = System.Text.Json.JsonSerializer.Deserialize <List <CartCompactItem> >(cartCookie);
            }
            return(Cart.Validate(items, equipment, spec));
        }
    protected void Page_Load(object sender, EventArgs e)

    {
        this.CurSessionConfig = new SessionConfig(0, ConfigurationManager.AppSettings["swordfish_v1_ConnectionString"]);
        if (!base.IsPostBack)
        {
            string text = Convert.ToString((int)(DateTime.Now.Year - 1));
            string str2 = Convert.ToString(DateTime.Now.Year);
            string str3 = Convert.ToString((int)(DateTime.Now.Year + 1));
            this.ddl_year.Items.Add(new ListItem(text, text));
            this.ddl_year.Items.Add(new ListItem(str2, str2));
            this.ddl_year.Items.Add(new ListItem(str3, str3));
            this.ddl_plant.Items.Add(new ListItem("", ""));
            this.ddl_plant.Items.Add(new ListItem("320", "320"));
            this.ddl_plant.Items.Add(new ListItem("820", "820"));
            this.ddl_dchannel.Items.Add(new ListItem("", ""));
            this.ddl_dchannel.Items.Add(new ListItem("3I", "3I"));
            this.ddl_dchannel.Items.Add(new ListItem("3O", "3O"));
            this.ddl_dchannel.Items.Add(new ListItem("3S", "3S"));
            using (UserManager manager = new UserManager(this.CurSessionConfig))
            {
                this.ddl_engineer.Items.Add(new ListItem("[All Engineer]", "%"));
                ApplicationUserCollection masterUsers = manager.GetMasterUsers();
                if (masterUsers != null)
                {
                    masterUsers.SortByName();
                    foreach (ApplicationUser user in masterUsers)
                    {
                        this.ddl_engineer.Items.Add(new ListItem(user.FirstName + " (" + user.UserID + ")", user.UserID));
                    }
                }
            }
            using (EquipmentManager manager2 = new EquipmentManager(this.CurSessionConfig))
            {
                this.ddl_EquipmProfile.Items.Add(new ListItem("[All Equipm. Profile]", "%"));
                EquipmentCollection allEquipmentProfiles = manager2.GetAllEquipmentProfiles();
                if (allEquipmentProfiles != null)
                {
                    allEquipmentProfiles.SortByName();
                    foreach (EquipmentObj obj2 in allEquipmentProfiles)
                    {
                        if (obj2.EquipmentProfileID.Length > 0)
                        {
                            this.ddl_EquipmProfile.Items.Add(new ListItem(obj2.EquipmentProfileID, obj2.EquipmentProfileID));
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 11
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            var t      = (UNetEquipmentCollectionCreator)target;
            var bridge = t.GetComponent <UNetActionsBridge>();

            EditorGUILayout.Space();
            EditorGUILayout.Space();

            using (new VerticalLayoutBlock("box"))
            {
                EditorGUILayout.LabelField("Editor", UnityEditor.EditorStyles.boldLabel);
                EditorGUILayout.LabelField("Copy collection data from CollectionUI component");

                _collectionUI = (EquipmentCollectionUI)EditorGUILayout.ObjectField(_collectionUI, typeof(EquipmentCollectionUI), true);
                if (_collectionUI != null)
                {
                    if (GUILayout.Button("Copy (overwrites old)"))
                    {
                        var collection = new EquipmentCollection <IEquippableItemInstance>(0, t.GetComponent <IEquippableCharacter <IEquippableItemInstance> >(), null);
                        _collectionUI.collection = collection;
//                        _collectionUI.IndexSlotsAndMountPoints();

                        t.slots = new UnitySerializedEquipmentCollectionSlot[_collectionUI.collection.slotCount];
                        for (int i = 0; i < _collectionUI.collection.slotCount; i++)
                        {
                            var equipmentTypes = new UnityEquipmentType[collection.slots[i].equipmentTypes.Length];
                            for (int j = 0; j < equipmentTypes.Length; j++)
                            {
                                equipmentTypes[j] = bridge.equipmentTypeDatabase.Get(new Identifier(collection.slots[i].equipmentTypes[j].ID)).result;
                            }

                            t.slots[i] = new UnitySerializedEquipmentCollectionSlot()
                            {
                                equipmentTypes = equipmentTypes,
                            };
                        }

                        EditorUtility.SetDirty(t);
                        GUI.changed = true;

                        Debug.Log($"Copied {_collectionUI.collection.slotCount} slots to player", t);
                        _collectionUI.collection = null;
                    }
                }
            }
        }
    public void UIAttemptEquip(OnUIItemAttemptEquipEventData e)
    {
        EquipmentCollection equipment = e.Equipper.GetComponentInChildren <EquipmentCollection>();

        e.Item.UIEmitter.Emit(
            new OnUIItemEquipEventData(
                e.Equipper,
                e.EquipmentPanel.GetSelectedSlot()
                )
            );
        if (equipment.IsItemInSlot(e.EquipmentSlot))
        {
            Item SelectedSlotItem = equipment.GetItemInSlot(e.EquipmentSlot);
            e.EquipmentPanel.SetCurrentItem(SelectedSlotItem);
        }
    }
Ejemplo n.º 13
0
        private EquipmentCollection _getEquipments(string sql, int pPageIndex, int pPageSize)
        {
            EquipmentCollection retobjs = new EquipmentCollection();
            SqlDataReader       sdr     = null;
            Equipment           obj     = null;

            m_db.RunSql(sql, out sdr);
            if (null == sdr)
            {
                return(null);
            }
            int _curRecPos = 0;
            //计算页记录///
            long _startpos = 0;
            long _endpos   = 0;

            if (pPageIndex > -1)
            {
                _startpos = pPageIndex * pPageSize;
                _endpos   = _startpos + pPageSize;
            }
            while (sdr.Read())
            {
                if (_curRecPos > _endpos)
                {
                    break;
                }
                if (_curRecPos >= _startpos && _curRecPos < _endpos)
                {
                    obj = this._buildEquipment(ref sdr);
                    if (null != obj)
                    {
                        retobjs.Add(obj);
                    }
                }
                _curRecPos++;
            }
            sdr.Close();
            if (retobjs.Count > 0)
            {
                return(retobjs);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 14
0
        private EquipmentCollection _getEquipments(string sql)
        {
            EquipmentCollection retobjs = new EquipmentCollection();
            SqlDataReader       sdr     = null;

            m_db.RunSql(sql, out sdr);
            if (null == sdr)
            {
                return(null);
            }
            while (sdr.Read())
            {
                retobjs.Add(this._buildEquipment(ref sdr));
            }
            sdr.Close();
            return(retobjs);
        }
    public void AttemptEquip(OnItemAttemptEquipEventData e)
    {
        EquipmentCollection equipment = e.Equipper.GetComponentInChildren <EquipmentCollection>();

        //only equip item if there is no item currently in slot
        if (EquipableTo.ContainsSlot(e.EquipmentSlot) &&
            !equipment.IsItemInSlot(e.EquipmentSlot) &&
            !equipment.IsEquipped(e.Item)
            )
        {
            e.Item.Emitter.Emit(
                new OnItemEquipEventData(
                    e.Equipper,
                    e.Item,
                    e.EquipmentSlot
                    )
                );
        }
    }
Ejemplo n.º 16
0
        public EquipmentCollection GetAllEquipmentProfiles()
        {
            EquipmentCollection equipments = null;

            if (this.TryConnection())
            {
                DataTable table = base.CurDBEngine.SelectQuery("SELECT DISTINCT " + this.DataStructrure.Tables.MasterEquipment.EquipmentProfile.ActualFieldName + " FROM " + this.DataStructrure.Tables.MasterEquipment.ActualTableName);
                if (table == null)
                {
                    return(equipments);
                }
                equipments = new EquipmentCollection();
                foreach (DataRow row in table.Rows)
                {
                    EquipmentObj obj2 = new EquipmentObj(row[this.DataStructrure.Tables.MasterEquipment.EquipmentProfile.ActualFieldName].ToString())
                    {
                        EquipmentSNR       = row[this.DataStructrure.Tables.MasterEquipment.EquipmentProfile.ActualFieldName].ToString(),
                        EquipmentProfileID = row[this.DataStructrure.Tables.MasterEquipment.EquipmentProfile.ActualFieldName].ToString()
                    };
                    equipments.Add(obj2);
                }
            }
            return(equipments);
        }
Ejemplo n.º 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.dbConnection = ConfigurationManager.AppSettings["swordfish_v1_ConnectionString"];

        this.CurSessionConfig = new SessionConfig(this.dbType, this.dbConnection);
        if (!base.IsPostBack)
        {
            int num = 0x7dc;
            for (int i = num; i <= (DateTime.Today.Year + 1); i++)
            {
                string text = i.ToString();
                this.ddl_year.Items.Add(new ListItem(text, i.ToString()));
                if (i == DateTime.Today.Year)
                {
                    this.ddl_year.SelectedIndex = this.ddl_year.Items.Count - 1;
                }
            }
            using (MasterManager manager = new MasterManager(this.CurSessionConfig))
            {
                //string[] plants = manager.GetPlants();
                this.ddl_plant.Items.Add(new ListItem("[All Plants]", ""));
                //foreach (string str in plants)
                //{
                //    this.ddl_plant.Items.Add(new ListItem(str, str));
                //}
                //string[] distChannel = manager.GetDistChannel();
                this.ddl_dchannel.Items.Add(new ListItem("[All Dist. Channel]", ""));
                //foreach (string str2 in distChannel)
                //{
                //    this.ddl_dchannel.Items.Add(new ListItem(str2, str2));
                //}
            }
            using (UserManager manager2 = new UserManager(this.CurSessionConfig))
            {
                this.ddl_Employee.Items.Add(new ListItem("[All Engineer]", "%"));
                ApplicationUserCollection masterUsers = manager2.GetMasterUsers();
                if (masterUsers != null)
                {
                    masterUsers.SortByName();
                    foreach (ApplicationUser user in masterUsers)
                    {
                        this.ddl_Employee.Items.Add(new ListItem(user.FirstName + " (" + user.UserID + ")", user.UserID));
                    }
                }
            }
            using (EquipmentManager manager3 = new EquipmentManager(this.CurSessionConfig))
            {
                this.ddl_EquipmProfile.Items.Add(new ListItem("[All Equipm. Profile]", "%"));
                EquipmentCollection allEquipmentProfiles = manager3.GetAllEquipmentProfiles();
                if (allEquipmentProfiles != null)
                {
                    allEquipmentProfiles.SortByName();
                    foreach (EquipmentObj obj2 in allEquipmentProfiles)
                    {
                        if (obj2.EquipmentProfileID.Length > 0)
                        {
                            this.ddl_EquipmProfile.Items.Add(new ListItem(obj2.EquipmentProfileID, obj2.EquipmentProfileID));
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 18
0
        public void Setup()
        {
            UnityEngine.Assertions.Assert.raiseExceptions = true;

            _restoreToCollection = new Collection <IItemInstance>(10, new Logger("[RestoreCollection] "));
            _equipmentCollection = new EquipmentCollection <IEquippableItemInstance>(5, null, new Logger("[Equipment] "));

            _headEquipmentType = new EquipmentType(Guid.NewGuid())
            {
                name = "Head"
            };
            _bodyEquipmentType = new EquipmentType(Guid.NewGuid())
            {
                name = "Body"
            };
            _feetEquipmentType = new EquipmentType(Guid.NewGuid())
            {
                name = "Feet"
            };
            _swordEquipmentType = new EquipmentType(Guid.NewGuid())
            {
                name = "Sword"
            };
            _shieldEquipmentType = new EquipmentType(Guid.NewGuid())
            {
                name = "Shield"
            };
            _twoHandedSwordEquipmentType = new EquipmentType(Guid.NewGuid(), _swordEquipmentType, _shieldEquipmentType, _arrowsEquipmentType)
            {
                name = "2 Handed sword"
            };
            _arrowsEquipmentType = new EquipmentType(Guid.NewGuid(), _swordEquipmentType, _shieldEquipmentType)
            {
                name = "Arrows"
            };

            _headItem           = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_headEquipmentType));
            _headItem2          = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_headEquipmentType));
            _bodyItem           = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_bodyEquipmentType));
            _feetItem           = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_feetEquipmentType));
            _swordItem          = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_swordEquipmentType));
            _shieldItem         = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_shieldEquipmentType));
            _twoHandedSwordItem = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_twoHandedSwordEquipmentType));
            _arrowsItem         = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_arrowsEquipmentType, 999));

            _mountPoint1 = new MockedMountPoint("1");
            _mountPoint2 = new MockedMountPoint("2");
            _mountPoint3 = new MockedMountPoint("3");
            _mountPoint4 = new MockedMountPoint("4");
            _mountPoint5 = new MockedMountPoint("5");

            _equipmentCollection.SetAllEquipmentTypes(new IEquipmentType[][]
            {
                new[] { _headEquipmentType },                                              // Head
                new[] { _bodyEquipmentType },                                              // Body
                new[] { _feetEquipmentType },                                              // Feet
                new[] { _swordEquipmentType, _twoHandedSwordEquipmentType },               // Right Hand
                new[] { _swordEquipmentType, _shieldEquipmentType, _arrowsEquipmentType }, // Left Hand
            });

//            _equipmentCollection.SetAllMountPoints(new IMountPoint<IEquippableItemInstance>[]
//            {
//                _mountPoint1,
//                _mountPoint2,
//                _mountPoint3,
//                _mountPoint4,
//                _mountPoint5,
//            });
        }
Ejemplo n.º 19
0
        public void Setup()
        {
            UnityEngine.Assertions.Assert.raiseExceptions = true;

            _restoreToCollection = new Collection <IItemInstance>(10, new Logger("[RestoreCollection] "));
            _equipmentCollection = new EquipmentCollection <IEquippableItemInstance>(5, _equippableCharacter, new Logger("[Equipment] "));
            _equippableCharacter = new EquippableCharacter <IItemInstance, IEquippableItemInstance>(_equipmentCollection, new CollectionGroup <IItemInstance>(_restoreToCollection), new Logger("[EquippableCharacter] "));
            _equipmentCollection.characterOwner = _equippableCharacter;

            _headEquipmentType = new EquipmentType(Guid.NewGuid())
            {
                name = "Head"
            };
            _bodyEquipmentType = new EquipmentType(Guid.NewGuid())
            {
                name = "Body"
            };
            _feetEquipmentType = new EquipmentType(Guid.NewGuid())
            {
                name = "Feet"
            };
            _swordEquipmentType = new EquipmentType(Guid.NewGuid())
            {
                name = "Sword"
            };
            _shieldEquipmentType = new EquipmentType(Guid.NewGuid())
            {
                name = "Shield"
            };
            _twoHandedSwordEquipmentType = new EquipmentType(Guid.NewGuid(), _swordEquipmentType, _shieldEquipmentType, _arrowsEquipmentType)
            {
                name = "2 Handed sword"
            };
            _arrowsEquipmentType = new EquipmentType(Guid.NewGuid(), _swordEquipmentType, _shieldEquipmentType)
            {
                name = "Arrows"
            };

            _headItem           = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_headEquipmentType));
            _bodyItem           = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_bodyEquipmentType));
            _feetItem           = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_feetEquipmentType));
            _swordItem          = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_swordEquipmentType));
            _swordItem2         = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_swordEquipmentType));
            _shieldItem         = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_shieldEquipmentType));
            _twoHandedSwordItem = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_twoHandedSwordEquipmentType));
            _arrowsItem         = new MockedEquippableItemInstance(Guid.NewGuid(), CreateDemoItemDef(_arrowsEquipmentType, 999));

            _equipmentCollection.SetAllEquipmentTypes(new IEquipmentType[][]
            {
                new[] { _headEquipmentType },                                              // Head
                new[] { _bodyEquipmentType },                                              // Body
                new[] { _feetEquipmentType },                                              // Feet
                new[] { _swordEquipmentType, _twoHandedSwordEquipmentType },               // Right Hand
                new[] { _swordEquipmentType, _shieldEquipmentType, _arrowsEquipmentType }, // Left Hand
            });

            var mountPoints = new IMountPoint <IEquippableItemInstance>[]
            {
                new MockedMountPoint("1"),
                new MockedMountPoint("2"),
                new MockedMountPoint("3"),
                new MockedMountPoint("4"),
                new MockedMountPoint("5"),
            };

//            _equipmentCollection.SetAllMountPoints(mountPoints);
            _equippableCharacter.mountPoints = mountPoints;
        }
Ejemplo n.º 20
0
        public IActionResult Index()
        {
            var equipment = EquipmentCollection.FromSampleFile(new EnglishDictionary());

            return(View("EquipmentCollection", equipment));
        }
Ejemplo n.º 21
0
    public void UICompareTo(OnUIItemEquipmentCompareEventData e)
    {
        e.StatChangesCollection.ClearAll();
        StatCollection playerStats = e.Player.GetComponentInChildren <StatCollection>();
        List <PlayerUIStatModifier> playerUIStats =
            new List <PlayerUIStatModifier>(playerStats.GetComponentsInChildren <PlayerUIStatModifier>());
        Dictionary <string, float> originalStatValues         = new Dictionary <string, float>();
        Dictionary <string, float> bonusStatValues            = new Dictionary <string, float>();
        Dictionary <string, PlayerUIStatModifier> renderables = new Dictionary <string, PlayerUIStatModifier>();

        foreach (PlayerUIStatModifier UIStat in playerUIStats)
        {
            foreach (KeyValuePair <string, float> stat in UIStat.BasedOnStats.GetAllStats())
            {
                if (!originalStatValues.ContainsKey(stat.Key))
                {
                    originalStatValues[stat.Key] = stat.Value;
                }
                else
                {
                    originalStatValues[stat.Key] += stat.Value;
                }
                if (!renderables.ContainsKey(stat.Key))
                {
                    renderables[stat.Key] = UIStat;
                }
            }
        }
        foreach (PlayerUIStatModifier UIStat in StatBonuses)
        {
            foreach (KeyValuePair <string, float> stat in UIStat.BasedOnStats.GetAllStats())
            {
                if (!bonusStatValues.ContainsKey(stat.Key))
                {
                    bonusStatValues[stat.Key] = stat.Value;
                }
                else
                {
                    bonusStatValues[stat.Key] += stat.Value;
                }
                if (!renderables.ContainsKey(stat.Key))
                {
                    renderables[stat.Key] = UIStat;
                }
            }
        }
        EquipmentCollection playerEquipment = e.Player.GetComponentInChildren <EquipmentCollection>();
        Item thisItem = GetComponent <Item>();

        //remove bonus values based on currently equipped item
        if (playerEquipment.IsItemInSlot(e.ForSlot))
        {
            Item i = playerEquipment.GetItemInSlot(e.ForSlot);
            PlayerUIStatModifier[] UIStats = i.GetComponentsInChildren <PlayerUIStatModifier>();
            if (!playerEquipment.IsEquipped(thisItem))
            {
                foreach (PlayerUIStatModifier UIStat in UIStats)
                {
                    foreach (KeyValuePair <string, float> stat in UIStat.BasedOnStats.GetAllStats())
                    {
                        if (!bonusStatValues.ContainsKey(stat.Key))
                        {
                            bonusStatValues[stat.Key] = -stat.Value;
                        }
                        else
                        {
                            bonusStatValues[stat.Key] -= stat.Value;
                        }
                        if (!renderables.ContainsKey(stat.Key))
                        {
                            renderables[stat.Key] = UIStat;
                        }
                    }
                }
            }
        }
        //remove bonus values based on if item is being re-equiped to another slot
        if (playerEquipment.IsEquipped(thisItem))
        {
            PlayerUIStatModifier[] UIStats =
                thisItem.GetComponentsInChildren <PlayerUIStatModifier>();
            foreach (PlayerUIStatModifier UIStat in UIStats)
            {
                foreach (KeyValuePair <string, float> stat in UIStat.BasedOnStats.GetAllStats())
                {
                    if (!bonusStatValues.ContainsKey(stat.Key))
                    {
                        bonusStatValues[stat.Key] = -stat.Value;
                    }
                    else
                    {
                        bonusStatValues[stat.Key] -= stat.Value;
                    }
                    if (!renderables.ContainsKey(stat.Key))
                    {
                        renderables[stat.Key] = UIStat;
                    }
                }
            }
        }
        foreach (KeyValuePair <string, PlayerUIStatModifier> UIStat in renderables)
        {
            if (originalStatValues.ContainsKey(UIStat.Key) &&
                bonusStatValues.ContainsKey(UIStat.Key) &&
                EquippableTo.ContainsSlot(e.ForSlot)
                )
            {
                e.StatChangesCollection.AddStatChange(
                    originalStatValues[UIStat.Key],
                    bonusStatValues[UIStat.Key],
                    UIStat.Value.Icon
                    );
            }
            else if (originalStatValues.ContainsKey(UIStat.Key) && EquippableTo.ContainsSlot(e.ForSlot))
            {
                e.StatChangesCollection.AddStatChange(
                    originalStatValues[UIStat.Key],
                    0,
                    UIStat.Value.Icon
                    );
            }
            else if (bonusStatValues.ContainsKey(UIStat.Key) && EquippableTo.ContainsSlot(e.ForSlot))
            {
                e.StatChangesCollection.AddStatChange(
                    0,
                    bonusStatValues[UIStat.Key],
                    UIStat.Value.Icon
                    );
            }
        }
    }
Ejemplo n.º 22
0
        static void Main(string[] args)
        {
            VenueServiceUtilJSON venueServiceUtilJson = new VenueServiceUtilJSON("venueserviceaseece.azurewebsites.net", "", "venueservice");

            //Test af GetEquipment
            EquipmentCollection equipmentCollection = venueServiceUtilJson.GetEquipment();
            //Testet og det virker

            //Test af post ConcertHall
            //Concerthall concerthall = new Concerthall();
            //concerthall.ConcertHallId = 21;
            //concerthall.ConcertHallName = "Det Nye Teater";
            //concerthall.IsLocatatVenue = "København";
            //concerthall.HallResponsible = "Børge Simonsen";
            //concerthall.HallsizeM2 = 210;
            //concerthall.StagesizeM2 = 21;
            //concerthall.MaxNoAudience = 210;
            //concerthall.NoOfDoors = 7;

            //List<Equipment> equipmentCollection2 = new List<Equipment>();
            //Equipment scene = new Equipment();
            //scene.EquipmentName = "scene";
            //scene.BelongsToConcertHall = "Det Nye Teater";
            //scene.EquipmentCount = 1;
            //scene.EquipmentId = 21;
            //scene.FactoryName = "Håndværksskolen";
            //equipmentCollection2.Add(scene);

            //concerthall.Equipment = equipmentCollection2;
            //venueServiceUtilJson.PostConcerthall(concerthall);
            //Testet og det virker (se hjemmeside med XML)

            //Der SKAL i følge opgaven laves to concerthalls - gøres nu:
            //Concerthall concerthall2 = new Concerthall();
            //List<Equipment> equipments = new List<Equipment>();
            //Equipment scenelys = new Equipment();
            //scenelys.EquipmentId = 321;
            //scenelys.BelongsToConcertHall = "House of Art";
            //scenelys.EquipmentCount = 5;
            //scenelys.EquipmentName = "scenelys";
            //scenelys.FactoryName = "Lysmesteren";
            //equipments.Add(scenelys);
            //equipments.Add(scene);
            //concerthall2.Equipment = equipments;
            //concerthall2.ConcertHallId = 321;
            //concerthall2.ConcertHallName = "House of Art";
            //concerthall2.HallResponsible = "James Williams";
            //concerthall2.HallsizeM2 = 3214;
            //concerthall2.IsLocatatVenue = "New York";
            //concerthall2.MaxNoAudience = 3000;
            //concerthall2.NoOfDoors = 32;
            //concerthall2.StagesizeM2 = 30;
            //venueServiceUtilJson.PostConcerthall(concerthall2);
            //Testet og det virker

            //Test af putEquipment
            Equipment gardin = new Equipment();

            gardin.EquipmentId          = 2;
            gardin.BelongsToConcertHall = "Det Nye Teater";
            gardin.EquipmentCount       = 1;
            gardin.EquipmentName        = "Gardin";
            gardin.FactoryName          = "Stof og stil";
            venueServiceUtilJson.PutEquipment(gardin);
            //Virker!!!

            //Skal gøres for 4 equipment tilknyttes til 2 koncerthuse
        }
Ejemplo n.º 23
0
        public static Subscriber Simplsub1()
        {
            //Location
            var loc = new Location
                {
                    ID = "5829224.3544318",
                    AddressLine1 = "8105 161ST AVE NE",
                    CityName = "REDMOND",
                    StateName = "WA",
                    ZipCode = "98052",
                    HeadendCode = "04",
                    CustomFields = DefaultCustomFields_Loc()
                };

            //Equipment
            const string unitAddr = "RDMDWAXAOL4-18-3-3";
            var equip = new EquipmentCollection
            {
                NewEquipment("MRCC00181AB9D01", EquipmentModels().Single(x=>x.TypeDescription == "AXS BPON ONT" && x.ModelDescription == "ONT1000M Data Port"), unitAddr, "ACTIVE"),
                NewEquipment("MRCC00181AB9M01", EquipmentModels().Single(x=>x.TypeDescription == "AXS BPON ONT" && x.ModelDescription == "ONT1000M MoCA Port"), unitAddr, "ACTIVE"),
                NewEquipment("MRCC00181AB9P01", EquipmentModels().Single(x=>x.TypeDescription == "AXS BPON ONT" && x.ModelDescription == "ONT1000M Phone Port"), unitAddr, "ACTIVE"),
                NewEquipment("MRCC00181AB9P02", EquipmentModels().Single(x=>x.TypeDescription == "AXS BPON ONT" && x.ModelDescription == "ONT1000M Phone Port"), unitAddr, "ACTIVE"),
                NewEquipment("MRCC00181AB9P03", EquipmentModels().Single(x=>x.TypeDescription == "AXS BPON ONT" && x.ModelDescription == "ONT1000M Phone Port"), unitAddr, "ACTIVE"),
                NewEquipment("MRCC00181AB9P04", EquipmentModels().Single(x=>x.TypeDescription == "AXS BPON ONT" && x.ModelDescription == "ONT1000M Phone Port"), unitAddr, "ACTIVE"),
                NewEquipment("M90937ZA8275", EquipmentModels().Single(x=>x.TypeDescription == "GI Digital" && x.ModelDescription == "QIP2500/ETHER"), "0000050810829002", "ACTIVE")
            };
            equip.ForEach(x => x.LocationId = loc.ID);

            //Services
            var svcs = new ServiceCollection
            {
                new Service { ClassName = "DATA - FTTH", Name = "F35M35M", Description = "35M DOWN 35M UP" },
                new Service { ClassName = "ONT PORT", Name = "MOCA", Description = "MOCA PORT" },
                new Service { ClassName = "VIDEO - BASICS", Name = "FIOS", Description = "FIOS VIDEO SERVICE" },
                new Service { ClassName = "VIDEO - BUNDLE/MISC", Name = "FIDS1", Description = "DOWNSTREAM PATH" },
                new Service { ClassName = "VIDEO - BUNDLE/MISC", Name = "FIVOD", Description = "VIDEO ON DEMAND SERV" },
                new Service { ClassName = "VIDEO - TIERS", Name = "FIES1", Description = "FIOS TV ESSENTIALS" },
                new Service { ClassName = "VIDEO - TIERS", Name = "FIHDS", Description = "HIGH DEFINITION -TRK" },
                new Service { ClassName = "VIDEO - TIERS", Name = "FIPR1", Description = "FIOS TV PREMIER" },
                new Service { ClassName = "VIDEO - TIERS", Name = "FIPR5", Description = "FIOS TV PREM ENH BIZ" },
                new Service { ClassName = "VOICE", Name = "VOICE", Description = "FTTH VOICE SERVICE" },
            };

            //ServiceProfiles
            var vsps = new List<ServiceProfile>
            {
                NewVoiceServiceProfile("4258818771", 1, 413, "MRCC00181AB9P01"),
                NewVoiceServiceProfile("4258699232", 1, 414, "MRCC00181AB9P02")
            };

            //Account
            var acct = new Account
            {
                AcctContactEmail = null,
                AcctContactName = null,
                AcctContactPhone = null,
                Email = null,
                Location = loc,
                Equipment = equip,
                ID = null,
                Name = null,
                PIN = null,
                PinRequired = false,
                PPVCap = "1.00",
                PPVEnabled = true,
                PPVPrivilege = "2",
                PPVResetDay = "15",
                ServiceEnabled = true,
                ServiceProfiles = vsps,
                Services = svcs
            };

            var sub = new Subscriber
            {
                ID = "370002312079",
                Name = "KIKUYA JAPANESE RESTAURAN",
                SubContactEmail = "*****@*****.**",
                SubContactPhone = "4258818771",
                CustomFields = new List<CustomField>
                {
                    new CustomField{Label ="Service_ID", Value=""},
                    new CustomField{Label = "PCAN", Value="F274112844"},
                    new CustomField{Label = "IP_TYPE", Value="DYNAMIC"},
                    new CustomField{Label = "Sub_WTN", Value=""},
                },
                Accounts = new List<Account> { acct }
            };
            return sub;
        }
Ejemplo n.º 24
0
    protected void PageComponentSetup()
    {
        int num = 0x7dc;

        for (int i = num; i <= (DateTime.Today.Year + 1); i++)
        {
            string text = i.ToString();
            this.ddl_year.Items.Add(new ListItem(text, i.ToString()));
            if (i == DateTime.Today.Year)
            {
                this.ddl_year.SelectedIndex = this.ddl_year.Items.Count - 1;
            }
        }
        for (int j = 1; j <= 12; j++)
        {
            string introduced26 = j.ToString();
            this.ddl_Month.Items.Add(new ListItem(introduced26, j.ToString()));
            if (j == DateTime.Today.Month)
            {
                this.ddl_Month.SelectedIndex = this.ddl_Month.Items.Count - 1;
            }
        }
        using (MasterManager manager = new MasterManager(this.CurSessionConfig))
        {
            //string[] plants = manager.GetPlants();
            this.ddl_plant.Items.Add(new ListItem("[All Plants]", ""));
            //foreach (string str in plants)
            //{
            //    this.ddl_plant.Items.Add(new ListItem(str, str));
            //}
            //string[] distChannel = manager.GetDistChannel();
            this.ddl_dchannel.Items.Add(new ListItem("[All Dist. Channel]", ""));
            //foreach (string str2 in distChannel)
            //{
            //    this.ddl_dchannel.Items.Add(new ListItem(str2, str2));
            //}
        }
        using (UserManager manager2 = new UserManager(this.CurSessionConfig))
        {
            ApplicationUserCollection masterUsers = manager2.GetMasterUsers();
            if ((masterUsers != null) && (masterUsers.Count > 0))
            {
                this.DropDownList_Engineer.Items.Add(new ListItem("[All Engineer]", "%"));
                foreach (ApplicationUser user in masterUsers)
                {
                    this.DropDownList_Engineer.Items.Add(new ListItem(user.FirstName + " (" + user.UserID + ")", user.UserID));
                }
            }
        }
        using (EquipmentManager manager3 = new EquipmentManager(this.CurSessionConfig))
        {
            this.ddl_EquipmProfile.Items.Add(new ListItem("[All Equipm. Profile]", "%"));
            EquipmentCollection allEquipmentProfiles = manager3.GetAllEquipmentProfiles();
            if (allEquipmentProfiles != null)
            {
                allEquipmentProfiles.SortByName();
                foreach (EquipmentObj obj2 in allEquipmentProfiles)
                {
                    if (obj2.EquipmentProfileID.Length > 0)
                    {
                        this.ddl_EquipmProfile.Items.Add(new ListItem(obj2.EquipmentProfileID, obj2.EquipmentProfileID));
                    }
                }
            }
        }
    }
Ejemplo n.º 25
0
 public EquipmentContainer()
 {
     Items = new EquipmentCollection <EquipmentItem>();
 }