Exemple #1
0
        public Location(Map map, Point position)
        {
            IsValid (map, position).AssertIsTrue ();

            Map = map;
            Position = position;
        }
Exemple #2
0
        public void Setup()
        {
            World world = new World ();
            Game.Instance.World = world;

            world.Map = new Map ();
            map = world.Map;
        }
Exemple #3
0
        public WorldView(Actor center)
        {
            this.center = center;
            map = center.Location.Map;

            SetupHandlers ();

            base.Events = EventMask.ButtonPressMask;
            base.CanFocus = true;
        }
Exemple #4
0
        public void ThereAreOneHundredGridsInATenByTenMap()
        {
            Map map = new Map (10, 10);

            int count = 0;

            for (int i = 0; i < 10; i++) {
                for (int j = 0; j < 10; j++) {
                    Assert.That (map[i, j], Is.Not.Null);
                    count++;
                }
            }

            Assert.That (count, Is.EqualTo (100));
        }
Exemple #5
0
 public void SetUp()
 {
     Map map = new Map (10, 10);
     actor = new MockActor (new Location (map, 2, 2));
     actor2 = new MockActor (new Location (map, 1, 2));
 }
Exemple #6
0
 public Location(Map map, int x, int y)
     : this(map, new Point (x, y))
 {
 }
Exemple #7
0
 private bool IsValid(Map map, Point position)
 {
     return map != null && map.GetGridInformation (position) != GridInformation.Invalid;
 }
Exemple #8
0
 public static Location GetRandom(Map map)
 {
     return new Location (map, Point.GetRandom (map.Width, map.Height));
 }
Exemple #9
0
 private void CenterLocationChangedHandler(object sender,
     LocationChangedEventArgs args)
 {
     map = args.NewLocation.Map;
     recenter = true;
 }