//type (string), name (string), affinity (int).
    public void AssignMonument(List <string> monumentArgs)
    {
        string   monumentType    = monumentArgs[0];
        Monument currentMonument = MonumentFactory.MakeMonument(monumentArgs);

        this.nations[monumentType].AddMonument(currentMonument);
    }
示例#2
0
    public void AssignMonument(List <string> monumentArgs)
    {
        Monument monument     = MonumentFactory.CreateMonument(monumentArgs);
        string   monumentName = monument.GetTypeName();

        this.nations[monumentName].AddMonument(monument);
    }
示例#3
0
    public void AssignMonument(List <string> monumentArgs)
    {
        var monumentFactory = new MonumentFactory();
        var monument        = monumentFactory.CreateMonument(monumentArgs);

        AddMonument(monument);
    }
 public NationsBuilder()
 {
     this.benderFactory   = new BenderFactory();
     this.monumentFactory = new MonumentFactory();
     this.nations         = new Dictionary <string, Nation>();
     this.warsList        = new List <string>();
 }
示例#5
0
    public void AssignMonument(List <string> monumentArgs)
    {
        string type = monumentArgs[0];

        switch (type)
        {
        case "Air":
            this.Nations[type].Monuments.Add(MonumentFactory.CreateMonument(monumentArgs));
            //this.AirNation.Monuments.Add(MonumentFactory.CreateMonument(monumentArgs));
            break;

        case "Water":
            this.Nations[type].Monuments.Add(MonumentFactory.CreateMonument(monumentArgs));
            //this.WaterNation.Monuments.Add(MonumentFactory.CreateMonument(monumentArgs));
            break;

        case "Fire":
            this.Nations[type].Monuments.Add(MonumentFactory.CreateMonument(monumentArgs));
            //this.FireNation.Monuments.Add(MonumentFactory.CreateMonument(monumentArgs));
            break;

        case "Earth":
            this.Nations[type].Monuments.Add(MonumentFactory.CreateMonument(monumentArgs));
            //this.EarthNation.Monuments.Add(MonumentFactory.CreateMonument(monumentArgs));
            break;
        }
    }
 public NationsBuilder()
 {
     this.allNations      = new List <Nation>();
     this.benderFactory   = new BenderFactory();
     this.monumentFactory = new MonumentFactory();
     this.wars            = new List <Nation>();
 }
示例#7
0
 public NationsBuilder()
 {
     this.benders         = new List <Bender>();
     this.monuments       = new List <Monument>();
     this.benderFactory   = new BenderFactory();
     this.monumentFactory = new MonumentFactory();
     this.wars            = new List <string>();
 }
示例#8
0
    public void AssignMonument(List <string> monumentArgs)
    {
        Monument monument = MonumentFactory.GetMonument(monumentArgs);
        string   type     = monument.GetType().FullName;

        type = type.Replace("Monument", "Bender");
        Nations[type].AddMonument(monument);
    }
示例#9
0
 public NationsBuilder()
 {
     this.airNation       = new Nation("Air");
     this.earthNation     = new Nation("Earth");
     this.fireNation      = new Nation("Fire");
     this.waterNation     = new Nation("Water");
     this.benderFactory   = new BenderFactory();
     this.monumentFactory = new MonumentFactory();
     this.issuedWars      = new List <string>();
 }
示例#10
0
    public void AssignMonument(List <string> monumentArgs)
    {
        string type = monumentArgs[0];

        if (nations.ContainsKey(type))
        {
            Monument monument = MonumentFactory.CreateMonument(monumentArgs);
            nations[type].AddMonument(monument);
        }
    }
    public void AssignMonument(List <string> monumentArgs)
    {
        var type     = monumentArgs[0];
        var name     = monumentArgs[1];
        var affinity = int.Parse(monumentArgs[2]);

        var monument = MonumentFactory.MakeMonument(type, name, affinity);

        this.nations[type].Monuments.Add(monument);
    }
    public void AssignMonument(List <string> monumentArgs)
    {
        //Monument {type} {name} {affinity}
        try
        {
            var      monumentType = monumentArgs[0];
            Monument newMonument  = MonumentFactory.CreateMonument(monumentArgs);

            nations[monumentType].AddMonument(newMonument);
        }
        catch (Exception)
        {
        }
    }
示例#13
0
 public NationsBuilder()
 {
     this.airNation   = new AirNation();
     this.earthNation = new EarthNation();
     this.fireNation  = new FireNation();
     this.waterNation = new WaterNation();
     this.allNations  = new List <Nation>()
     {
         airNation, earthNation, fireNation, waterNation
     };
     this.warRecord       = new StringBuilder();
     this.benderFactory   = new BenderFactory();
     this.monumentFactory = new MonumentFactory();
     this.warNumber       = 1;
 }
示例#14
0
    public NationsBuilder()
    {
        this.benderFactory     = new BenderFactory();
        this.monumentFactory   = new MonumentFactory();
        this.nationsIssuedWars = new List <string>();

        nations = Assembly.GetExecutingAssembly()
                  .GetTypes()
                  .Where(t => t.IsClass && t.Name.EndsWith(nameof(Bender)))
                  .Select(t => t.Name.Substring(0, t.Name.Length - nameof(Bender).Length))
                  .ToArray();

        this.bendersByNation   = nations.ToDictionary(nation => nation, value => new List <IBender>());
        this.monumentsByNation = nations.ToDictionary(nation => nation, value => new List <IMonument>());
    }
示例#15
0
    public void AssignMonument(List <string> monumentArgs)
    {
        string type     = monumentArgs[1];
        string name     = monumentArgs[2];
        int    affinity = int.Parse(monumentArgs[3]);

        try
        {
            Monument monument = MonumentFactory.CreateMonument(type, name, affinity);
            nations.Where(n => n.Name == type).FirstOrDefault().AddMonment(monument);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
示例#16
0
 public NationsBuilder()
 {
     this.nations = new Dictionary <string, List <Bender> >()
     {
         { "Air", new List <Bender>() },
         { "Fire", new List <Bender>() },
         { "Earth", new List <Bender>() },
         { "Water", new List <Bender>() }
     };
     this.monuments = new Dictionary <string, List <Monument> >()
     {
         { "Air", new List <Monument>() },
         { "Fire", new List <Monument>() },
         { "Earth", new List <Monument>() },
         { "Water", new List <Monument>() }
     };
     this.benderFactory   = new BenderFactory();
     this.monumentFactory = new MonumentFactory();
     this.issuedWars      = new List <string>();
 }
    public void AssignMonument(List <string> monumentArgs)
    {
        Monument monument = MonumentFactory.Create(monumentArgs);
        string   type     = monumentArgs[1];

        if (type == "Air")
        {
            airMonuments.Add(monument);
        }
        else if (type == "Water")
        {
            waterMonuments.Add(monument);
        }
        else if (type == "Fire")
        {
            fireMonuments.Add(monument);
        }
        else if (type == "Earth")
        {
            earthMonuments.Add(monument);
        }
    }
    public void AssignMonument(List <string> monumentArgs)
    {
        var monumentType = monumentArgs[0];

        monuments[monumentType].Add(MonumentFactory.CreateMonument(monumentArgs));
    }
示例#19
0
    public void AssignMonument(List <string> monumentArgs)
    {
        Monument monument = MonumentFactory.CreateMonument(monumentArgs);

        nations[monumentArgs[1]].AddMonument(monument);
    }
示例#20
0
    public void AssignMonument(List <string> monumentArgs)
    {
        Monument monument = MonumentFactory.CreateMonument(monumentArgs);

        this.monuments.Add(monument);
    }
 public NationsBuilder()
 {
     this.InitializeNations();
     this.benderFactory   = new BenderFactory();
     this.monumentFactory = new MonumentFactory();
 }
示例#22
0
    public void AssignMonument(List <string> monumentArgs)
    {
        var monument = MonumentFactory.Monument(monumentArgs);

        monuments[monumentArgs[0]].Add(monument);
    }