Example #1
0
        /// <summary>
        /// Load your graphics content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be use to draw textures.
            batch = new SpriteBatch (graphics.GraphicsDevice);

            // Load all textures
            textures = new Dictionary<string, Texture2D> ();
            foreach (string name in Textures.ALL) {
                Texture2D texture = Content.Load<Texture2D> (name);
                textures.Add (name, texture);
            }

            country.addLocation (0, 400, 200);
            country.addLocation (1, 250, 300);
            country.addLocation (2, 550, 400);
            country.addLocation (3, 350, 550);
            country.addLocation (4, 385, 400);

            country.calcDistance ();

            //create a population noble
            NobleModel noble = new NobleModel(country, 0, 0, 2, "pop");
            noble.position.X = noble.position.X + 50;
            NobleSprite popNoble = new NobleSprite(noble);
            nobles.Add(popNoble);

            //add the pop noble
            LocationSprite loc;

            if(country.locations.TryGetValue(0, out loc))
            {
                loc.addNoble(popNoble);
            }

            foreach (LocationSprite location in country.locations.Values) {
                //location.populationTimer = 0; unecessary in constructor
                locations.Add(location);
            }
        }
Example #2
0
 public void addNoble( NobleSprite noble)
 {
     this.nobles.Add(noble);
 }