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()); }
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]; }
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)); }
public SegmentQuery(IMongoDatabase mapDatabase, IMapFactory factory, float x, float y) : this(mapDatabase) { getStrategy = () => { var map = factory.GetMap(); return(map[x, y]); }; }
public SegmentQuery(IMongoDatabase mapDatabase, IMapFactory factory, int i, int j) : this(mapDatabase) { getStrategy = () => { var map = factory.GetMap(); return(map[i, j]); }; }
private void CreateMap() { map = factory.GetMap(); }
private void CreateMapObject() { var map = mapFactory.GetMap(); mapObject = new MapObject(id, map); }