예제 #1
0
    /**
     * Determine if this TechLevel is greater than another one
     */
    public bool gt(TechLevel other)
    {
        bool foundGT = false;

        foreach (TechField field in Enum.GetValues(typeof(TechField)))
        {
            if (level(field) < other.level(field))
            {
                return(false);
            }
            if (level(field) > other.level(field))
            {
                foundGT = true;
            }
        }
        return(foundGT);
    }
예제 #2
0
 /**
  * Determine if this TechLevel is lower than another one
  */
 public bool lt(TechLevel other)
 {
     foreach (TechField field in Enum.GetValues(typeof(TechField)))
     {
         if (level(field) < other.level(field))
         {
             return(true);
         }
     }
     return(false);
 }
예제 #3
0
    public TechField getNextField()
    {
        TechField field = currentResearchField;

        if (nextResearchField == NextResearchField.SameField)
        {
            field = currentResearchField;
        }
        else if (nextResearchField != NextResearchField.LowestField)
        {
            field = (TechField)Enum.Parse(typeof(TechField), nextResearchField.ToString(), true);
        }

        int nextLevel = techLevels.level(field);

        if (nextLevel >= Consts.maxTechLevel || nextResearchField == NextResearchField.LowestField)
        {
            field = techLevels.lowest();
        }

        return(field);
    }