コード例 #1
0
ファイル: PackSelection.cs プロジェクト: yakoder/NRaas
 public override ObjectPicker.ColumnInfo GetValue(SimDescription item)
 {
     if (item == null)
     {
         return(new ObjectPicker.TextColumn(""));
     }
     else
     {
         return(new ObjectPicker.TextColumn(Porter.GetExportCount(item).ToString()));
     }
 }
コード例 #2
0
            public override ObjectPicker.ColumnInfo GetValue(HouseholdItem item)
            {
                Household house = item.Value;

                int total = 0;

                if (house.IsServiceNpcHousehold)
                {
                    foreach (SimDescription sim in SimDescription.GetHomelessSimDescriptionsFromUrnstones())
                    {
                        if (Porter.GetExportCount(sim) > 0)
                        {
                            total++;
                        }
                    }
                }
                else
                {
                    foreach (SimDescription sim in house.AllSimDescriptions)
                    {
                        if (Porter.GetExportCount(sim) > 0)
                        {
                            total++;
                        }
                    }
                }

                if (total == Households.NumSims(house))
                {
                    return(new ObjectPicker.TextColumn(Common.Localize("Packed:Yes")));
                }
                else if (total > 0)
                {
                    return(new ObjectPicker.TextColumn(Common.Localize("Packed:Partial")));
                }
                else
                {
                    return(new ObjectPicker.TextColumn(Common.Localize("Packed:No")));
                }
            }