コード例 #1
0
        private bool DrawProductionInput(ref float y, EggProduction p)
        {
            Widgets.Label(new Rect(40, y, 150, 22), "MMG.IntervalInDays".Translate());
            string value = Widgets.TextField(new Rect(200, y, 100, 22), p.IntervalDays.ToString());

            if (int.TryParse(value, out int i) && i != p.IntervalDays && i >= 0)
            {
                p.IntervalDays = i;
                return(true);
            }
            y += NEWLINE;
            Widgets.Label(new Rect(40, y, 150, 22), "MMG.CountRangeMinMax".Translate());
            value = Widgets.TextField(new Rect(200, y, 100, 22), p.CountMin.ToString());
            if (int.TryParse(value, out i) && i != p.CountMin && i >= 0)
            {
                p.CountMin = i;
                return(true);
            }
            value = Widgets.TextField(new Rect(310, y, 100, 22), p.CountMax.ToString());
            if (int.TryParse(value, out i) && i != p.CountMax && i >= 0)
            {
                p.CountMax = i;
                return(true);
            }
            y += NEWLINE;
            Widgets.Label(new Rect(40, y, 150, 22), "MMG.FertalizedCountMax".Translate());
            value = Widgets.TextField(new Rect(200, y, 100, 22), p.FertalizedCountMax.ToString());
            if (int.TryParse(value, out i) && i != p.FertalizedCountMax && i >= 0)
            {
                p.FertalizedCountMax = i;
                return(true);
            }
            y += NEWLINE;
            return(false);
        }
コード例 #2
0
 public void DefaultHarpyEggs()
 {
     this.HarpyEggs = new EggProduction()
     {
         IntervalDays       = 10,
         CountMin           = 1,
         CountMax           = 1,
         FertalizedCountMax = 1,
     };
 }
コード例 #3
0
 private void SetCompProps(CompProperties_EggLayer compProps, EggProduction p)
 {
     if (compProps != null)
     {
         compProps.eggCountRange.min        = p.CountMin;
         compProps.eggCountRange.max        = p.CountMax;
         compProps.eggFertilizationCountMax = p.FertalizedCountMax;
         compProps.eggLayIntervalDays       = p.IntervalDays;
     }
 }