Example #1
0
    public void AssignBender(List <string> benderArgs)
    {
        string type  = benderArgs[0];
        string name  = benderArgs[1];
        int    power = int.Parse(benderArgs[2]);
        double sec   = double.Parse(benderArgs[3]);

        switch (type)
        {
        case "Air":
            airnation.AddBender(new AirBender(name, power, sec));
            break;

        case "Water":
            waternation.AddBender(new WaterBender(name, power, sec));
            break;

        case "Fire":
            firenation.AddBender(new FireBender(name, power, sec));
            break;

        case "Earth":
            earthnation.AddBender(new EarthBender(name, power, sec));
            break;

        default:
            throw new ArgumentException("no Bender Added");
        }
    }
Example #2
0
    public void AssignBender(List <string> benderArgs)
    {
        Bender bender = this.benderFactory.CreateBender(benderArgs);

        switch (benderArgs[0])
        {
        case "Air":
            airNation.AddBender(bender);
            break;

        case "Fire":
            fireNation.AddBender(bender);
            break;

        case "Earth":
            earthNation.AddBender(bender);
            break;

        case "Water":
            waterNation.AddBender(bender);
            break;
        }
    }