Exemplo n.º 1
0
        public Location(Map map, Point position)
        {
            IsValid (map, position).AssertIsTrue ();

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

            world.Map = new Map ();
            map = world.Map;
        }
Exemplo n.º 3
0
        public WorldView(Actor center)
        {
            this.center = center;
            map = center.Location.Map;

            SetupHandlers ();

            base.Events = EventMask.ButtonPressMask;
            base.CanFocus = true;
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
 }
Exemplo n.º 6
0
 public Location(Map map, int x, int y)
     : this(map, new Point (x, y))
 {
 }
Exemplo n.º 7
0
 private bool IsValid(Map map, Point position)
 {
     return map != null && map.GetGridInformation (position) != GridInformation.Invalid;
 }
Exemplo n.º 8
0
 public static Location GetRandom(Map map)
 {
     return new Location (map, Point.GetRandom (map.Width, map.Height));
 }
Exemplo n.º 9
0
 private void CenterLocationChangedHandler(object sender,
     LocationChangedEventArgs args)
 {
     map = args.NewLocation.Map;
     recenter = true;
 }