1using System.Globalization;
24 public virtual void Update(
float dt) {
34 return base.GetSlotCapacity(slotIndex, value);
39 public override void AddSlotItems(
int slotIndex,
int value,
int count) {
41 base.AddSlotItems(slotIndex, value, count);
52 for (
int i = 0; i < originalCount.Length; i++) {
70 count = count / m_matchedRecipe.ResultCount *
m_matchedRecipe.ResultCount;
71 num = base.RemoveSlotItems(slotIndex, count);
73 for (
int i = 0; i < 9; i++) {
85 if (componentPlayer !=
null
87 componentPlayer.PlayerStats.ItemsCrafted += num;
93 num = base.RemoveSlotItems(slotIndex, count);
99 for (
int i = 0; i < originalCount.Length; i++) {
100 if (originalCount[i] > 0
123 base.Load(valuesDictionary, idToEntityMap);
129 int num =
int.MaxValue;
132 int num2 = i + j * 3;
140 m_matchedIngredients[num2] = $
"{block.GetCraftingId(slotValue)}:{num4.ToString(CultureInfo.InvariantCulture)}";
151 if (recipeRefindNeeded) {
162 if (craftingRecipe !=
null
173 if (craftingRecipe !=
null
174 && !
string.IsNullOrEmpty(craftingRecipe.
Message)) {
175 string message = craftingRecipe.
Message;
176 if (message.StartsWith(
'[')
177 && message.EndsWith(
']')) {
static int Min(int x1, int x2)
static int Max(int x1, int x2)
virtual int GetMaxStacking(int value)
override int GetSlotCapacity(int slotIndex, int value)
override int RemoveSlotItems(int slotIndex, int count)
实际移除的数量
bool m_recipeUpdateNeeded
string[] m_matchedIngredients
override void DropAllItems(Vector3 position)
virtual void Update(float dt)
override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
override void AddSlotItems(int slotIndex, int value, int count)
CraftingRecipe m_matchedRecipe
bool m_recipeRefindNeeded
virtual void UpdateCraftingResult(bool recipeRefindNeeded)
bool m_resetWhenSlotItemsRemoved
virtual void DisplaySmallMessage(string text, Color color, bool blinking, bool playNotificationSound)
virtual int GetSlotCount(int slotIndex)
Project IInventory. Project
static void DropSlotItems(IInventory inventory, int slotIndex, Vector3 position, Vector3 velocity)
virtual int GetSlotValue(int slotIndex)
ComponentPlayer FindInteractingPlayer()
ComponentGui ComponentGui
static CraftingRecipe FindMatchingRecipe(SubsystemTerrain terrain, string[] ingredients, float heatLevel, float playerLevel)
static string Get(string className, int key)
获取在当前语言类名键对应的字符串
static int ExtractContents(int value)
static int ExtractData(int value)
ValuesDictionary ValuesDictionary
static Vector3 Normalize(Vector3 v)