protected override bool PrivateUpdate(ScenarioFrame frame) { bool success = false; foreach (GameObject obj in GetInventory(Sim)) { Gem gem = obj as Gem; if ((gem != null) && (string.IsNullOrEmpty(gem.mCutName))) { if (CutGem(gem)) { continue; } } else { Metal metal = obj as Metal; if ((metal != null) && (!metal.mHasBeenSmelt)) { if (SmeltMetal(metal)) { continue; } } else { Rock rock = obj as Rock; if ((rock != null) && (!rock.mAnalyzed)) { if (rock.AnalyzeMe(Sim.CreatedSim)) { continue; } } else { MinorPet pet = obj as MinorPet; if (pet != null) { if (PlacePet(pet)) { continue; } } } } } SimDescription sim = Sim; if (!sim.IsHuman) { sim = SimTypes.HeadOfFamily(Sim.Household); } int value = Money.Sell(sim, obj); mFunds += value; AddStat("Sold", value); success = true; } return(success); }