Exemplo n.º 1
0
        public async Task <IEnumerable <MapObject> > GetAllMovingObjectsAsync()
        {
            var map    = mapFactory.GetMap();
            var models = await objects.Find(data => data.IsMoving).ToListAsync();

            return(models.Select(model => new MapObject(model, map)).ToList());
        }
Exemplo n.º 2
0
        private void LoadSegmentData()
        {
            var map = mapFactory.GetMap();
            var x   = objectJson.Value <float>("Location.X");
            var y   = objectJson.Value <float>("Location.Y");

            objectSegment = map[x, y];
        }
Exemplo n.º 3
0
        public Task <JObject> GetJsonAsync()
        {
            var map    = factory.GetMap();
            var result = new { Segments = new { Width = map.SegmentsWidth, Height = map.SegmentsHeight } };
            var json   = JObject.FromObject(result);

            return(Task.FromResult(json));
        }
Exemplo n.º 4
0
 public SegmentQuery(IMongoDatabase mapDatabase, IMapFactory factory, float x, float y)
     : this(mapDatabase)
 {
     getStrategy = () =>
     {
         var map = factory.GetMap();
         return(map[x, y]);
     };
 }
Exemplo n.º 5
0
 public SegmentQuery(IMongoDatabase mapDatabase, IMapFactory factory, int i, int j)
     : this(mapDatabase)
 {
     getStrategy = () =>
     {
         var map = factory.GetMap();
         return(map[i, j]);
     };
 }
Exemplo n.º 6
0
 private void CreateMap()
 {
     map = factory.GetMap();
 }
Exemplo n.º 7
0
        private void CreateMapObject()
        {
            var map = mapFactory.GetMap();

            mapObject = new MapObject(id, map);
        }