Esempio n. 1
0
 public void ParseDependency(ExcelLoading.AbstractObject rep)
 {
     try
     {
         ExcelLoading.WildAnimalItem aniRep = rep as ExcelLoading.WildAnimalItem;
         if (aniRep.tamed_to.Length > 0 && aniRep.tamed_to[0] != '-')
         {
             m_tamedTo = DomesticAnimal.GetAnimal(aniRep.tamed_to);
         }
     }catch (Exception e)
     {
         Debug.LogException(e);
     }
 }
Esempio n. 2
0
    /// <summary>
    /// parsing excel data into current format
    /// </summary>
    /// <param name="mat">target</param>
    /// <param name="rep">source</param>
    /// <returns> parsed item </returns>
    /// <returns></returns>
    public static new AbstractObject Parse(AbstractObject mat, ExcelLoading.AbstractObject rep)
    {
        WildAnimal ani = mat as WildAnimal;

        ExcelLoading.WildAnimalItem aniRep = rep as ExcelLoading.WildAnimalItem;
        if (ani != null && aniRep != null)
        {
            ani.m_attack       = aniRep.attack;
            ani.m_protection   = aniRep.protection;
            ani.m_speed        = aniRep.speed;
            ani.m_scary        = aniRep.scary;
            ani.m_minInSquadre = decimal.ToInt32(aniRep.minimal_in_squadre);
            ani.m_maxInSquadre = decimal.ToInt32(aniRep.maximum_in_squadre);
            ani.m_chanceToTame = aniRep.chance_to_tame;

            _sAllWildAnimal.Add(ani);
        }
        else
        {
            Debug.Log("WildAnimal.Parse: critical parse error");
        }

        return(AbstractAnimal.Parse(mat, rep));
    }