// Use this for initialization void Start() { DeactivateTooltip(); CanvasRectTransform = Canvas.GetComponent<RectTransform>(); RectTransform = TooltipPanel.GetComponent<RectTransform>(); InventoryManager = GameObject.FindGameObjectWithTag("InventoryManager").GetComponent<InventoryManager>(); }
public override string Execute(string[] args, UUID fromAgentID) { if (args.Length < 2) { return "Usage: give <agent uuid> <item1> [item2] [item3] [...]"; } UUID dest; if (!UUID.TryParse(args[0], out dest)) { return "First argument expected agent UUID."; } Manager = Client.Inventory; Inventory = Client.InventoryStore; string ret = ""; string nl = "\n"; for (int i = 1; i < args.Length; ++i) { string itemPath = args[i]; List<InventoryBase> results = Inventory.InventoryFromPath(itemPath, Client.CurrentDirectory, true); if (results.Count == 0) { ret += "No inventory item at " + itemPath + " found." + nl; } else { results[0].Give(dest, true); ret += "Gave " + results[0].Name + nl; } } return ret; }
protected void btnSave_Click(object sender, EventArgs e) { InventoryManager iManager = new InventoryManager(this); Inventory inventory = new Inventory(); inventory.ProductId = Convert.ToInt32(cboProducts.SelectedValue); inventory.DepositId = Convert.ToInt32(cboDeposit.SelectedValue); inventory.CompanyId = Company.CompanyId; try { iManager.InventoryDrop(inventory, ucCurrFieldQuantity.IntValue, (int)DropType.Transfer, null); } catch (InvalidOperationException ex) { ShowError(Resources.Exception.InvalidStockQuantity); return; } ClientScript.RegisterClientScriptBlock(this.GetType(), "", "alert('Baixa no Estoque efetuada com sucesso!');", true); }
internal InventoryItem(InventoryManager manager, InventoryDescendentsPacket.ItemDataBlock itemData) : base(manager) { _Name = System.Text.Encoding.UTF8.GetString(itemData.Name).Trim().Replace("\0", ""); _Description = System.Text.Encoding.UTF8.GetString(itemData.Description).Trim().Replace("\0", ""); _CreationDate = itemData.CreationDate; _InvType = itemData.InvType; _Type = itemData.Type; _AssetID = itemData.AssetID; _FolderID = itemData.FolderID; _GroupOwned = itemData.GroupOwned; _GroupID = itemData.GroupID; _GroupMask = itemData.GroupMask; _CreatorID = itemData.CreatorID; _OwnerID = itemData.OwnerID; _OwnerMask = itemData.OwnerMask; _Flags = itemData.Flags; _BaseMask = itemData.BaseMask; _EveryoneMask = itemData.EveryoneMask; _NextOwnerMask = itemData.NextOwnerMask; _SaleType = itemData.SaleType; _SalePrice = itemData.SalePrice; _CRC = itemData.CRC; }
/// <summary> /// </summary> /// <param name="manager"></param> /// <param name="ii"></param> internal InventoryNotecard(InventoryManager manager, InventoryItem ii) : base( manager, ii._Name, ii._Description, ii._FolderID, ii._InvType, ii._Type, ii._CreatorID) { if ((ii.InvType != 7) || (ii.Type != (sbyte)Asset.AssetType.Notecard)) { throw new Exception("The InventoryItem cannot be converted to a Notecard, wrong InvType/Type."); } this.iManager = manager; this._ItemID = ii._ItemID; this._Asset = ii._Asset; this._AssetID = ii._AssetID; this._BaseMask = ii._BaseMask; this._CRC = ii._CRC; this._CreationDate = ii._CreationDate; this._EveryoneMask = ii._EveryoneMask; this._Flags = ii._Flags; this._GroupID = ii._GroupID; this._GroupMask = ii._GroupMask; this._GroupOwned = ii._GroupOwned; this._InvType = ii._InvType; this._NextOwnerMask = ii._NextOwnerMask; this._OwnerID = ii._OwnerID; this._OwnerMask = ii._OwnerMask; this._SalePrice = ii._SalePrice; this._SaleType = ii._SaleType; this._Type = ii._Type; }
public ComposeManager(InventoryManager inventoryManager) { m_inventoryManager = inventoryManager; AddListener(); m_versionID = inventoryManager.m_versionId; Instance = this; }
internal InventoryImage( InventoryManager manager, InventoryItem ii ) : base(manager, ii._Name, ii._Description, ii._FolderID, ii._InvType, ii._Type, ii._CreatorID) { if( (ii.InvType != 0) || (ii.Type != Asset.ASSET_TYPE_IMAGE) ) { throw new Exception("The InventoryItem cannot be converted to a Image/Texture, wrong InvType/Type."); } this.iManager = manager; this._Asset = ii._Asset; this._AssetID = ii._AssetID; this._BaseMask = ii._BaseMask; this._CRC = ii._CRC; this._CreationDate = ii._CreationDate; this._EveryoneMask = ii._EveryoneMask; this._Flags = ii._Flags; this._GroupID = ii._GroupID; this._GroupMask = ii._GroupMask; this._GroupOwned = ii._GroupOwned; this._InvType = ii._InvType; this._NextOwnerMask = ii._NextOwnerMask; this._OwnerID = ii._OwnerID; this._OwnerMask = ii._OwnerMask; this._SalePrice = ii._SalePrice; this._SaleType = ii._SaleType; this._Type = ii._Type; }
internal InventoryFolder(InventoryManager manager, String name, LLUUID folderID, LLUUID parentID, sbyte Type) : base(manager) { this._Name = name; this._FolderID = folderID; this._ParentID = parentID; this._Type = Type; }
/// <summary> /// </summary> /// <param name="manager"></param> internal InventoryBase(InventoryManager manager) { if( manager == null ) { throw new Exception( "Inventory Manager cannot be null" ); } iManager = manager; }
internal InventoryFolder(InventoryManager manager) : base(manager) { _Name = ""; _FolderID = LLUUID.Zero; _ParentID = LLUUID.Zero; _Type = -1; }
internal InventoryFolder(InventoryManager manager, Dictionary<string, string> htData) : base(manager) { this._Name = htData["name"]; this._FolderID = new LLUUID(htData["folder_id"]); this._ParentID = new LLUUID(htData["parent_id"]); this._Type = sbyte.Parse(htData["type_default"].ToString()); }
// Initializing void Awake() { if (manager == null) manager = this; else if (manager != this) Destroy(gameObject); Initialize(); }
public DecomposeManager(Dictionary<int, ItemParent> _equipmentDic, InventoryManager _inventory) { Instance = this; m_inventory = _inventory; m_equipmentDic = _equipmentDic; m_versionID = m_inventory.m_versionId; AddListener(); }
public void OnEnable() { _target = (Container) target; if (AdvGame.GetReferences () && AdvGame.GetReferences ().inventoryManager) { inventoryManager = AdvGame.GetReferences ().inventoryManager; } }
void Start() { if (instance !=null) { Destroy (gameObject, 0f); return; } instance = this; DontDestroyOnLoad(gameObject); }
void Awake() { _instance = this; inventoryItemDBController = this.GetComponent<InventoryItemDBController>(); inventoryItemDBController.OnGetInventoryItemDBList += this.OnGetInventoryItemDBList; inventoryItemDBController.OnAddInventoryItemDB += this.OnAddInventoryItemDB; ReadInventoryInfo(); }
void Awake() { Player = GetComponent<PlayerManager>(); Inventory = GetComponent<InventoryManager>(); _startSequence = new List<IGameManager>(); _startSequence.Add(Player); _startSequence.Add(Inventory); StartCoroutine(StartupManager()); }
void Awake() { _instance = this; ReadInventoryInfo(); idbController = this.GetComponent<InventoryItemDBController>(); idbController.OnGetInventoryItemDB += this.OnGetInventoryItemDB; idbController.OnAddInventoryItemDB += this.OnAddInventoryItemDB; idbController.OnUpdateInventoryItemDB += this.OnUpdateInventoryItemDB; }
public virtual void Start() { inventory = FindObjectOfType<InventoryManager>(); SetSelectable(); baseColors = new Color[parts.Length]; baseMaterials = new Material[parts.Length]; for (int i = 0; i < parts.Length; i++) { baseColors[i] = parts[i].renderer.material.color; baseMaterials[i] = parts[i].renderer.material; } }
public CharacterEntity(Game mGame, int mX, int mY, int mZ, string mName, bool mHostile) : base(mGame, mX, mY, mZ, mName) { _statusManager = new StatusManager(); _inventoryManager = new InventoryManager(); behaviors = new List<Behavior>(); visibleThisTurn = new List<Entity>(); perceptionRange = 20; hostile = mHostile; Game.LogAdd("#" + UID + ": new 'CharacterEntity' named '" + Name + "' - (" + X + ";" + Y + ")", true); }
void OnEnable() { GlobalEvents.AddListener<AddItemToMixerEvent>(AddItemToMix); if (interactableScript == null) { interactableScript = GetComponent<ItemMixer>(); } if (null == inventory) { inventory = GameObject.FindGameObjectWithTag("Inventory").GetComponent<InventoryManager>(); } }
public void GetCar() { Car existingCar = new Car() { CarId = 1 }; Mock<IDataRepositoryFactory> mockDataRepositoryFactory = new Mock<IDataRepositoryFactory>(); mockDataRepositoryFactory.Setup(mock => mock.GetDataRepository<ICarRepository>().Get(1)).Returns(existingCar); InventoryManager manager = new InventoryManager(mockDataRepositoryFactory.Object); Car retrievedCar = manager.GetCar(1); Assert.IsTrue(retrievedCar == existingCar); }
protected void grdReceive_RowDeleting(object sender, GridViewDeleteEventArgs e) { InventoryManager invManager = new InventoryManager(this); InventoryMoviment movement = new InventoryMoviment(); int movementId = Convert.ToInt16(grdReceive.DataKeys[e.RowIndex]["InventoryMovementId"]); int destinationCompanyId = Convert.ToInt16(grdReceive.DataKeys[e.RowIndex]["CompanyDestinationId"]); invManager.RefuseMovement(movementId); grdReceive.DataBind(); e.Cancel = true; }
void Awake() { if (!Instance) { Instance = this; } slotRects = new List<RectTransform>(); GameObject[] slotObjects = GameObject.FindGameObjectsWithTag("Slot Tile"); for (int i = 0; i < slotObjects.Length; i++) { slotRects.Add(slotObjects[i].GetComponent<RectTransform>()); } }
//[HideInInspector] // set the object to not be destroyed on new scene loading void Awake() { //Debug.Log("created new grid"); //if we don't have an [_instance] set yet if (!_instance) _instance = this; //otherwise, if we do, kill this thing else Destroy(this.gameObject); DontDestroyOnLoad(this.gameObject); //DontDestroyOnLoad(transform.gameObject); }
public void UpdateCar_UpdateExisting() { Car existingCar = new Car() { CarId = 1 }; Car updatedCar = new Car() { CarId = 1 }; Mock<IDataRepositoryFactory> mockDataRepositoryFactory = new Mock<IDataRepositoryFactory>(); mockDataRepositoryFactory.Setup(mock => mock.GetDataRepository<ICarRepository>().Update(existingCar)).Returns(updatedCar); InventoryManager manager = new InventoryManager(mockDataRepositoryFactory.Object); Car updateCarResults = manager.UpdateCar(existingCar); Assert.IsTrue(updateCarResults == updatedCar); }
public void UpdateCar_AddNew() { Car newCar = new Car(); Car addedCar = new Car() { CarId = 1 }; Mock<IDataRepositoryFactory> mockDataRepositoryFactory = new Mock<IDataRepositoryFactory>(); mockDataRepositoryFactory.Setup(mock => mock.GetDataRepository<ICarRepository>().Add(newCar)).Returns(addedCar); InventoryManager manager = new InventoryManager(mockDataRepositoryFactory.Object); Car updateCarResults = manager.UpdateCar(newCar); Assert.IsTrue(updateCarResults == addedCar); }
public void UpdateCar_add_new() { var newCar = new Car(); var addedCar = new Car() { CarId = 1 }; var mockRepositoryFactory = new Mock<IDataRepositoryFactory>(); mockRepositoryFactory.Setup(obj => obj.GetDataRepository<ICarRepository>().Add(newCar)).Returns(addedCar); var manager = new InventoryManager(mockRepositoryFactory.Object); var results = manager.UpdateCar(newCar); Assert.IsTrue(results == addedCar); }
public void UpdateCar_update_existing() { Car existingCar = new Car() { CarId = 1 }; Car updatedCar = new Car() { CarId = 1 }; var mockRepositoryFactory = new Mock<IDataRepositoryFactory>(); mockRepositoryFactory.Setup(obj => obj.GetDataRepository<ICarRepository>().Update(existingCar)).Returns(updatedCar); var manager = new InventoryManager(mockRepositoryFactory.Object); var results = manager.UpdateCar(existingCar); Assert.IsTrue(results == updatedCar); }
// Use this for initialization void Start() { invManagerScript = invManager.GetComponent<InventoryManager>(); lookIcon.renderer.enabled = false; useIcon.renderer.enabled = false; storeIcon.renderer.enabled = false; invArray = invManagerScript.cells; //for(int i = 0; i < invArray.Length; i++) //{ // Debug.Log(invArray[i].name); //} }
private void OpenGetArmory() { var profile = GetProfile <JobArmoryProfile>(); var player = Cache.Player; new Menu($"{Label} | Vapen") { Items = new List <MenuItem>() { new MenuItem("WEAPON_STUNGUN", "Elpistol", "PISTOL", WeaponHash.StunGun, 1, typeof(StungunItem)), new MenuItem("WEAPON_NIGHTSTICK", "Batong", "PISTOL", WeaponHash.Nightstick, 1, typeof(NightstickItem)), new MenuItem("WEAPON_FLAREGUN", "Signalpistol", "PISTOL", WeaponHash.FlareGun, 5, typeof(FlaregunItem)), new MenuItem("WEAPON_COMBATPISTOL", "Sig Sauer", "PISTOL", WeaponHash.CombatPistol, 250, typeof(PistolItem)), new MenuItem("WEAPON_SMG", "MP5", "RIFLE", WeaponHash.SMG, 250, typeof(Mp5Item)), }, Callback = async(menu, item, operation) => { var entity = player.Entity; var merchant = profile.Merchant; if (operation.Type == MenuOperationType.Select) { await merchant.NetworkModule.Claim(); await merchant.AnimationQueue.PlayDirectInQueue(new AnimationBuilder() .Select("mp_cop_armoury", $"{item.Metadata[0].ToString().ToLower()}_on_counter_cop") .SkipTask() .On(async() => { await BaseScript.Delay(100); entity.Weapons.Select(WeaponHash.Unarmed); merchant.Weapons.Give((WeaponHash)item.Metadata[1], (int)item.Metadata[2], true, true); }) ); await BaseScript.Delay(100); var builder = new AnimationBuilder() .Select("mp_cop_armoury", $"{item.Metadata[0].ToString().ToLower()}_on_counter") .On(async() => { await BaseScript.Delay(4000); merchant.Weapons.RemoveAll(); entity.Weapons.Give((WeaponHash)item.Metadata[1], (int)item.Metadata[2], true, true); }); entity.AnimationQueue.AddToQueue(builder).PlayQueue(); await builder.TaskWhenPlayed(); entity.Weapons.Select(WeaponHash.Unarmed); var weapon = (WeaponItem)Activator.CreateInstance((Type)item.Metadata[3]); weapon.Metadata["Weapon.Ammo"] = (int)item.Metadata[2]; if (!ItemHelper.Give(InventoryManager.GetModule().GetContainer("equipment_inventory"), weapon)) { player.ShowNotification($"Du har inte plats med en {item.Label}!"); } } else if (operation.Type == MenuOperationType.PostClose) { OpenGeneralMenu(); } } }.Commit(); }