// Token: 0x06002A1A RID: 10778 RVA: 0x0009C170 File Offset: 0x0009A370 public void ItemClicked(GameObject go) { if (global::RPOS.ObservedPlayer.GetComponent <global::CraftingInventory>().isCrafting) { return; } global::RPOSCraftItemEntry component = go.GetComponent <global::RPOSCraftItemEntry>(); if (component == null) { return; } global::BlueprintDataBlock blueprint = component.blueprint; if (!blueprint) { Debug.Log("no bp by that name"); return; } if (blueprint != this.selectedItem) { this.SetSelectedItem(component.blueprint); this.UpdateIngredients(); } }
// Token: 0x06002AF6 RID: 10998 RVA: 0x0009F798 File Offset: 0x0009D998 public global::RPOSCraftItemEntry GetEntryByBP(global::BlueprintDataBlock bp) { foreach (object obj in base.transform) { global::RPOSCraftItemEntry component = (obj as Transform).GetComponent <global::RPOSCraftItemEntry>(); if (component && component.blueprint == bp) { return(component); } } return(null); }
// Token: 0x06002A17 RID: 10775 RVA: 0x0009BFEC File Offset: 0x0009A1EC public void SetSelectedItem(global::BlueprintDataBlock newSel) { if (this.selectedItem) { } this.selectedItem = newSel; this.SetRequestedAmount(1); if (this.selectedItem) { } this.ShowCraftingOptions(this.selectedItem != null); this.UpdateWorkbenchRequirements(); }
// Token: 0x06002FB3 RID: 12211 RVA: 0x000B7A8C File Offset: 0x000B5C8C protected void UpdateCrafting(global::BlueprintDataBlock blueprint, int amount, float start, float dur, float progress, float progresspersec) { Debug.Log(string.Format("Craft network update :{0}:", (!blueprint) ? "NONE" : blueprint.name), this); this._lastThinkTime = global::NetCull.time; this.crafting.blueprint = blueprint; this.crafting.inProgress = blueprint; this.crafting.startTime = start; this.crafting.duration = dur; this.crafting.progressSeconds = progress; this.crafting.progressPerSec = progresspersec; this.crafting.amount = amount; this.Refresh(); }
// Token: 0x06002FB2 RID: 12210 RVA: 0x000B7A40 File Offset: 0x000B5C40 public bool StartCrafting(global::BlueprintDataBlock blueprint, int amount) { if (blueprint.CanWork(amount, this)) { base.networkView.RPC("CRFS", 0, new object[] { amount, blueprint.uniqueID }); return(true); } return(false); }
// Token: 0x06002FBC RID: 12220 RVA: 0x000B7BD4 File Offset: 0x000B5DD4 public bool Restart(global::Inventory inventory, int amount, global::BlueprintDataBlock blueprint, ulong startTimeMillis) { if (!blueprint || !blueprint.CanWork(amount, inventory)) { this = default(global::CraftingSession); return(false); } this.blueprint = blueprint; this.startTime = (float)(startTimeMillis / 1000.0); this.duration = blueprint.craftingDuration * (float)amount; this.progressPerSec = 1f; this.progressSeconds = 0f; this.amount = amount; this.inProgress = true; return(true); }
// Token: 0x06003D35 RID: 15669 RVA: 0x000DB014 File Offset: 0x000D9214 public virtual global::BlueprintDataBlock GetMatchingDBForItems() { ArrayList arrayList = new ArrayList(); foreach (global::ItemDataBlock itemDataBlock in global::DatablockDictionary.All) { if (itemDataBlock is global::BlueprintDataBlock) { global::BlueprintDataBlock blueprintDataBlock = itemDataBlock as global::BlueprintDataBlock; bool flag = true; foreach (global::BlueprintDataBlock.IngredientEntry ingredientEntry in blueprintDataBlock.ingredients) { int num = 0; global::IInventoryItem inventoryItem = this._inventory.FindItem(ingredientEntry.Ingredient, out num); if (inventoryItem == null || num < ingredientEntry.amount) { flag = false; break; } } if (flag) { arrayList.Add(blueprintDataBlock); } } } if (arrayList.Count > 0) { global::BlueprintDataBlock result = null; int num2 = -1; foreach (object obj in arrayList) { global::BlueprintDataBlock blueprintDataBlock2 = (global::BlueprintDataBlock)obj; if (blueprintDataBlock2.ingredients.Length > num2) { result = blueprintDataBlock2; num2 = blueprintDataBlock2.ingredients.Length; } } return(result); } return(null); }
public void ReceiveBoundBPs(byte[] data, uLink.NetworkMessageInfo info) { this._boundBPs = (this._boundBPs ?? new List <global::BlueprintDataBlock>()); this._boundBPs.Clear(); BitStream bitStream = new BitStream(data, false); int num = bitStream.ReadInt32(); for (int i = 0; i < num; i++) { int uniqueID = bitStream.ReadInt32(); global::ItemDataBlock byUniqueID = global::DatablockDictionary.GetByUniqueID(uniqueID); if (byUniqueID) { global::BlueprintDataBlock item = byUniqueID as global::BlueprintDataBlock; this._boundBPs.Add(item); } } this.Refresh(); }
// Token: 0x06002FA8 RID: 12200 RVA: 0x000B78FC File Offset: 0x000B5AFC public bool ValidateCraftRequirements(global::BlueprintDataBlock bp) { return(!bp.RequireWorkbench || this.AtWorkBench()); }
// Token: 0x06003A95 RID: 14997 RVA: 0x000CDA18 File Offset: 0x000CBC18 public bool KnowsBP(global::BlueprintDataBlock bp) { return(bp && this._boundBPs.Contains(bp)); }