public void link_members(Industrial_species sp) { sp.grid = FindName(sp.name + "_g") as Grid; sp.title = FindName(sp.name + "_n") as TextBlock; sp.chart = FindName(sp.name + "_Chart") as ProgressBar; }
public int affect(ref Industrial_species sp) { ////Formula Affecting Change; //double change = ((sp.healthy - (percent_affect * effectiveness)) <= 0) ? (sp.healthy * (1 - percent_affect) * effectiveness) : ((sp.healthy - (percent_affect * effectiveness))); //sp.healthy = (change > 1000) ? 1000 : change; if (available > 0) { double change = (1000 - sp.healthy) * (percent_affect * effectiveness); sp.healthy += change; available--; return (int)change;///Formula for Adding XP } else return 0; }