Esempio n. 1
0
        public void ClearNewEquipmentMarks()
        {
//			_newEquipmentMarksDictionary.Clear();
//			if (onNewEquipmentMarksChangedDelegate != null)
//			{
//				onNewEquipmentMarksChangedDelegate();
//			}

            EquipModelLuaTable.GetLuaFunction("ClearNewEquipmentMarks").Call();
        }
Esempio n. 2
0
        public void SetEquipmentAsChecked(int equipmentInstanceID)
        {
//			if (_newEquipmentMarksDictionary.ContainsKey(equipmentInstanceID))
//			{
//				_newEquipmentMarksDictionary.Remove(equipmentInstanceID);
//				if (onNewEquipmentMarksChangedDelegate != null)
//				{
//					onNewEquipmentMarksChangedDelegate();
//				}
//			}

            EquipModelLuaTable.GetLuaFunction("SetEquipmentAsChecked").Call(equipmentInstanceID);
        }
Esempio n. 3
0
        public Dictionary <int, EquipmentInfo> GetAllEquipmentInfoDictioary()
        {
//			return _equipmentsDictionary;

            Dictionary <int, EquipmentInfo> allEquipmentInfoDictionary = null;
            LuaFunction getAllEquipmentInfoDictionaryLuaFunction       = EquipModelLuaTable.GetLuaFunction("GetAllEquipmentInfoDictionary");
            LuaTable    allEquipmentInfoLuaTable = (LuaTable)getAllEquipmentInfoDictionaryLuaFunction.Call(null)[0];

            if (allEquipmentInfoLuaTable != null)
            {
                allEquipmentInfoDictionary = new Dictionary <int, EquipmentInfo>();
                foreach (DictionaryEntry kvp in allEquipmentInfoLuaTable.ToDictTable())
                {
                    int           equipmentInstanceID   = kvp.Key.ToString().ToInt32();
                    LuaTable      equipmentInfoLuaTable = (LuaTable)kvp.Value;
                    EquipmentInfo equipmentInfo         = new EquipmentInfo(equipmentInfoLuaTable);
                    allEquipmentInfoDictionary.Add(equipmentInstanceID, equipmentInfo);
                }
            }
            return(allEquipmentInfoDictionary);
        }
Esempio n. 4
0
        public bool IsNewEquipment(int instanceID)
        {
//			return _newEquipmentMarksDictionary.ContainsKey(instanceID);

            return(EquipModelLuaTable.GetLuaFunction("IsNewEquipment").Call(instanceID)[0].ToString().ToBoolean());
        }
Esempio n. 5
0
//		public bool AddEquipmentInfo (EquipmentInfo equipmentInfo, bool isNew)
//		{
//			if (_equipmentsDictionary.ContainsKey(equipmentInfo.instanceID))
//			{
//				return false;
//			}
//			_equipmentsDictionary.Add(equipmentInfo.instanceID, equipmentInfo);
//			if (isNew)
//			{
//				_newEquipmentMarksDictionary.Add(equipmentInfo.instanceID, equipmentInfo);
//			}
//			return true;
//		}

//		public bool RemoveEquipmentInfo (int instanceID)
//		{
//			return _equipmentsDictionary.Remove(instanceID);
//		}

//		public void UpdateEquipmentInfo (Equip equip)
//		{
//			GetEquipmentInfoByInstanceID(equip.id).Update(equip);
//			if (onEquipmentInfoUpdateDelegate != null)
//			{
//				onEquipmentInfoUpdateDelegate(equip.id);
//			}
//		}

        public bool HasNewEquipment()
        {
//			return _newEquipmentMarksDictionary.Count > 0;

            return(EquipModelLuaTable.GetLuaFunction("HasNewEquipment").Call(null)[0].ToString().ToBoolean());
        }
Esempio n. 6
0
        public int GetAllEquipmentCount()
        {
//			return _equipmentsDictionary.Count;

            return(EquipModelLuaTable.GetLuaFunction("GetAllEquipmentCount").Call(null)[0].ToString().ToInt32());
        }