internal static bool Prefix(Panel_ActionsRadial __instance, ref Il2CppSystem.Collections.Generic.List <GearItem> __result) { __result = new Il2CppSystem.Collections.Generic.List <GearItem>(); for (int index = 0; index < GameManager.GetInventoryComponent().m_Items.Count; ++index) { GearItem component = GameManager.GetInventoryComponent().m_Items[index].m_GearItem; if (component.m_FoodItem != null && component.m_FoodItem.m_IsDrink) { if (component.m_IsInSatchel) { __result.Insert(0, component); } else { __result.Add(component); } } if (WaterUtils.ContainsPotableWater(component)) { if (component.m_IsInSatchel) { __result.Insert(0, component); } else { __result.Add(component); } } } return(false); }
public static void RegisterTowerInInventory(ShopTowerDetailsModel details, string insertBefore, Il2CppSystem.Collections.Generic.List <TowerDetailsModel> allTowersInTheGame) { // get the tower details for the tower insertBefore and insert the new tower into the index towerBefore is at, shifting everything after it by 1 TowerDetailsModel towerAfter = allTowersInTheGame.ToArray().FirstOrDefault(tower => tower.towerId == insertBefore); allTowersInTheGame.Insert(allTowersInTheGame.IndexOf(towerAfter), details); }