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

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

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

            SetupHandlers ();

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