Esempio n. 1
0
 public TravelerLocationModel(TravelerLocation t, string userId)
 {
     this.Id         = t.Id;
     this.UserId     = userId;
     this.TravelerId = t.TravelerId;
     this.Latitude   = t.Latitude;
     this.Longitude  = t.Longitude;
     this.TimeStamp  = t.PositionTimestamp;
 }
        public override bool BumpedIntoObject(TravelerLocation location)
        {
            bool retVal = false;

            Block block = SimulationArea[location.X, location.Y];

            if (block != null)
            {
                //BumpedObject = true;
                traveler.location = location;
                if (!block.IsEndSimulation)
                {
                    retVal            = true;
                    AccumulatedScore += block.Score;
                }
            }

            return(retVal);
        }
Esempio n. 3
0
        public async Task <TravelerLocation> PostTravelerLocation(TravelerLocation loc)
        {
            TravelerLocation val = await Task.Factory.StartNew <TravelerLocation>(() =>
            {
                TravelerLocation result = new TravelerLocation();

                var client       = new RestClient(URI_STRING);
                client.UserAgent = USER_AGENT;
                var request      = new RestRequest("/api/TravelerLocation", Method.POST);

                request.RequestFormat = DataFormat.Json;

                request.AddBody(loc);

                IRestResponse <TravelerLocation> response = client.Execute <TravelerLocation>(request);

                result = response.Data;

                return(result);
            });

            return(val);
        }