Exemplo n.º 1
0
    private void AddSpecies(Species.ValueType first, Species.ValueType second, float chance, Species.ValueType result)
    {
        if (!KeyValues.ContainsKey(first))
        {
            var list = new List <MutationInfo>();
            list.Add(new MutationInfo(second, chance, result));
            KeyValues.Add(first, list);
        }
        else
        {
            var list = KeyValues[first];
            list.Add(new MutationInfo(second, chance, result));
        }

        if (!KeyValues.ContainsKey(second))
        {
            var list = new List <MutationInfo>();
            list.Add(new MutationInfo(first, chance, result));
            KeyValues.Add(second, list);
        }
        else
        {
            var list = KeyValues[second];
            list.Add(new MutationInfo(first, chance, result));
        }
    }
Exemplo n.º 2
0
 public List <Sprite> GetSprites(Species.ValueType value)
 {
     try
     {
         return(_dictionary[value]);
     }
     catch (KeyNotFoundException)
     {
         Debug.LogError($"[BeeIconDictionary] icon for {value} is null");
         return(null);
     }
 }
Exemplo n.º 3
0
 public SpeciesItem(List <BeeItem> list)
 {
     this.list = list;
     count     = 1;
     if (list.Count > 0)
     {
         species = list[0].bee.GetSpecies();
         beeType = list[0].bee.type;
     }
     else
     {
         Debug.LogError("[SpeciesItem] Empty list!");
     }
 }
Exemplo n.º 4
0
    /// <summary>
    /// Returns MutationInfo
    /// </summary>
    /// <param name="type"></param>
    /// <returns>can return null</returns>
    public static List <MutationInfo> GetMutationInfo(Species.ValueType type)
    {
        List <MutationInfo> list;

        if (KeyValues.TryGetValue(type, out list))
        {
            return(list);
        }
        else
        {
            Debug.LogError("[SpeciesDictionary] Can't find species in dictionary!");
            return(null);
        }
    }
Exemplo n.º 5
0
 public static Allele GetAllele(Species.ValueType value)
 {
     return(KeyValues[value]);
 }
Exemplo n.º 6
0
 public MutationInfo(Species.ValueType secondSpecies, float chance, Species.ValueType result)
 {
     SecondSpecies = secondSpecies;
     Chance        = chance;
     Result        = result;
 }
Exemplo n.º 7
0
 public MutationPairChromosomeInfo(Species.ValueType value, bool isMain)
 {
     this.value  = value;
     this.isMain = isMain;
 }