Ejemplo n.º 1
0
        private static void AddCategories(SightseeingDbContext context)
        {
            var museum = new AttractionCategory
            {
                AttractionCategoryId = Guid.Parse("{24a31ba7-4030-48ed-a705-c5584f7ff860}"),
                Name = "Museum"
            };

            var castle = new AttractionCategory
            {
                AttractionCategoryId = Guid.Parse("{b3cbceac-72ab-4c12-9d36-2292a33265f8}"),
                Name = "Castle"
            };

            var cathedral = new AttractionCategory
            {
                AttractionCategoryId = Guid.Parse("{6909101a-5a1f-433a-b2db-11038e4ffff7}"),
                Name = "Cathedral"
            };

            var temple = new AttractionCategory
            {
                AttractionCategoryId = Guid.Parse("{7e12db9e-5648-4385-a9dc-abe24f1fbc4b}"),
                Name = "Temple"
            };

            context.AttractionCategories.AddRange(museum, castle, cathedral, temple);
            context.SaveChanges();
        }
Ejemplo n.º 2
0
 public float GetCurrentInterest(AttractionCategory interestCategory)
 {
     if (CurrentInterests.ContainsKey(interestCategory))
     {
         return(CurrentInterests[interestCategory]);
     }
     if (CurrentSocialInterests.ContainsKey(interestCategory))
     {
         return(CurrentSocialInterests[interestCategory]);
     }
     else
     {
         return(0f);
     }
 }
Ejemplo n.º 3
0
        private static async Task AddCategories(SightseeingDbContext context)
        {
            if (await context.AttractionCategories.AnyAsync())
            {
                return;
            }

            var museum = new AttractionCategory
            {
                AttractionCategoryId = Guid.Parse("{24a31ba7-4030-48ed-a705-c5584f7ff860}"),
                Name = "Museum"
            };

            var castle = new AttractionCategory
            {
                AttractionCategoryId = Guid.Parse("{b3cbceac-72ab-4c12-9d36-2292a33265f8}"),
                Name = "Castle"
            };

            var cathedral = new AttractionCategory
            {
                AttractionCategoryId = Guid.Parse("{6909101a-5a1f-433a-b2db-11038e4ffff7}"),
                Name = "Cathedral"
            };

            var temple = new AttractionCategory
            {
                AttractionCategoryId = Guid.Parse("{7e12db9e-5648-4385-a9dc-abe24f1fbc4b}"),
                Name = "Temple"
            };

            var amphitheatre = new AttractionCategory
            {
                AttractionCategoryId = Guid.Parse("{720ba5a2-0faf-4c2c-9d19-8c56da17e62b}"),
                Name = "Amphitheatre"
            };

            var palace = new AttractionCategory
            {
                AttractionCategoryId = Guid.Parse("{bbc05cbc-fdd1-41df-8bfd-f662c8663858}"),
                Name = "Palace"
            };

            context.AttractionCategories.AddRange(museum, castle, cathedral, temple, amphitheatre, palace);
            await context.SaveChangesAsync();
        }
Ejemplo n.º 4
0
    public AttractionZone GetMostVisiblePointOfInterest(AttractionCategory interestCategory)
    {
        AttractionZone mostVisiblePointOfInterest = null;
        var            maxFoundVisibility         = 0f;

        if (!Simulation.Instance.PointsOfInterest.ContainsKey(interestCategory))
        {
            return(null);
        }

        foreach (var poi in Simulation.Instance.PointsOfInterest[interestCategory])
        {
            var poiVisibility = poi.GetVisibilityAt(this.transform.position);
            if (poiVisibility > maxFoundVisibility)
            {
                mostVisiblePointOfInterest = poi;
                maxFoundVisibility         = poiVisibility;
            }
        }
        return(mostVisiblePointOfInterest);
    }