예제 #1
0
 public KnightModel(CountryModel country, int a, int b, int speed)
 {
     this.path = construct (a, b, BFS (a, b, country.adjacencies, country.distances, country.n));
     this.position = KingdomRising.country.locations[a].model.center;
     this.fX = position.X;
     this.fY = position.Y;
     this.previous = path [0];
     this.next = path [1];
     this.speed = speed;
     this.size = new Size(Dimensions.KNIGHT_WIDTH, Dimensions.KNIGHT_HEIGHT);
     this.end = b;
 }
예제 #2
0
        /// <summary>
        /// Overridden from the base Game.Initialize. Once the GraphicsDevice is setup,
        /// we'll use the viewport to initialize some values.
        /// </summary>
        protected override void Initialize()
        {
            this.IsMouseVisible = true;

            bool[, ] adjacencies = new bool[, ] {
                {false, true, true, false, false},
                {false, false, false, false, false},
                {false, false, false, false, true},
                {false, true, false, false, false},
                {false, false, false, true, false} };

            country = new CountryModel (adjacencies, 5);

            knights = new HashSet<Knight> ();
            locations = new HashSet<LocationSprite> ();
            nobles = new HashSet<NobleSprite> ();

            base.Initialize ();
        }