Пример #1
0
        public static async Task <OutfitList> grabDataFromDaybreakCensus()
        {
            var censusObject = new OutfitList();

            const string requestItem = "outfit";
            const string queryObjs   = "member,member_online_status,member_character(name)";

            var urlString = string.Format("https://{0}/{1}/get/{2}/{3}/{4}/?c:resolve={5}",
                                          Properties.Settings.Default.DaybreakURL,
                                          Properties.Settings.Default.DaybreakResponseFormat,
                                          Properties.Settings.Default.DaybreakPlanetsideQuery,
                                          requestItem,
                                          Properties.Settings.Default.AODRId,
                                          queryObjs);

            string xmlResponse;

            using (var client = new WebClient())
            {
                xmlResponse = await client.DownloadStringTaskAsync(urlString);

                censusObject = Common.XmlTools.DeserializeXMLFromString <OutfitList>(xmlResponse);
            }

            return(censusObject);
        }
 private void PopulateList()
 {
     foreach (var gear in _prototypeManager.EnumeratePrototypes <StartingGearPrototype>())
     {
         OutfitList.Add(GetItem(gear, OutfitList));
     }
 }
Пример #3
0
    public void ChangeCurrentOutfit(OutfitList outfit)
    {
        List <Material> toChange = new List <Material>();

        switch (outfit)
        {
        case OutfitList.Casual:
            toChange = currentAreaMaterials.casualOutfit;
            break;

        case OutfitList.Janitor:
            toChange = currentAreaMaterials.janitorOutfit;
            break;

        case OutfitList.ZooKeeper:
            toChange = currentAreaMaterials.zooKeeperOutfit;
            break;
        }

        for (int i = 0; i < toChange.Count; i++)
        {
            meshRenderers[i].material = toChange[i];
        }

        CurrentOutfit = outfit;
    }
 private void PopulateByFilter(string filter)
 {
     OutfitList.Clear();
     foreach (var gear in _prototypeManager.EnumeratePrototypes <StartingGearPrototype>())
     {
         if (!string.IsNullOrEmpty(filter) &&
             gear.ID.ToLowerInvariant().Contains(filter.Trim().ToLowerInvariant()))
         {
             OutfitList.Add(GetItem(gear, OutfitList));
         }
     }
 }
    public OutfitsNeededDetails ReturnOutfitDetails(OutfitList outfit)
    {
        OutfitsNeededDetails toReturn = null;

        foreach (OutfitsNeededDetails needed in outfitsNeeded)
        {
            if (needed.outfitNeeded == outfit)
            {
                toReturn = needed;
                break;
            }
        }
        return(toReturn);
    }
Пример #6
0
    public float ReturnOutfitLevel(OutfitList type)
    {
        float toReturn = 0;

        switch (type)
        {
        case OutfitList.Janitor:
            toReturn = janitorLevel;
            break;

        case OutfitList.ZooKeeper:
            toReturn = zooKeeperLevel;
            break;
        }
        return(toReturn);
    }
Пример #7
0
    public List <Material> ReturnPlayerMaterial(OutfitList outfit)
    {
        List <Material> mat = null;

        switch (outfit)
        {
        case OutfitList.Casual:
            mat = casualOutfit;
            break;

        case OutfitList.Janitor:
            mat = janitorOutfit;
            break;

        case OutfitList.ZooKeeper:
            mat = zooKeeperOutfit;
            break;
        }

        return(mat);
    }
Пример #8
0
    public void AcceptOutfit(OutfitList outfit)
    {
        switch (outfit)
        {
        case OutfitList.Casual:
            currentOutfit      = 0;
            displayedText.text = "Casual";
            break;

        case OutfitList.Janitor:
            currentOutfit      = 1;
            displayedText.text = "Janitor";
            break;

        case OutfitList.ZooKeeper:
            currentOutfit      = 2;
            displayedText.text = "Zoo Keeper";
            break;
        }
        thisButton.onClick.AddListener(AttachOutfit);
    }
    public void ActivateBuilding(OutfitList outfit)
    {
        List <int> canUse        = new List <int>(buildingDetails.Count);
        int        buildingIndex = 0;

        foreach (BuildingDetails details in buildingDetails)
        {
            bool hasGot = false;
            foreach (OutfitsNeededDetails outfitsNeeded in details.outfitsNeeded)
            {
                if (outfit == outfitsNeeded.outfitNeeded)
                {
                    hasGot = true;
                    break;
                }
            }
            if (hasGot)
            {
                switch (details.BuildingType)
                {
                case BuildingType.Bathroom:
                    if (bathroomList.Count == 0)
                    {
                        hasGot = false;
                    }
                    else
                    {
                        buildingIndex = 0;
                    }
                    break;

                case BuildingType.SmallExhibition:
                    if (exhibitBuildingList.Count == 0)
                    {
                        hasGot = false;
                    }
                    else
                    {
                        buildingIndex = 1;
                    }
                    break;

                case BuildingType.MediumExhibition:
                    if (exhibitBuildingList.Count == 0)
                    {
                        hasGot = false;
                    }
                    else
                    {
                        buildingIndex = 1;
                    }
                    break;

                case BuildingType.LargeExhibition:
                    if (exhibitBuildingList.Count == 0)
                    {
                        hasGot = false;
                    }
                    else
                    {
                        buildingIndex = 1;
                    }
                    break;
                }
            }
            if (hasGot)
            {
                canUse.Add(buildingIndex);
            }
        }
        int             rand             = Random.Range(0, canUse.Count);
        VisitorBuilding selectedBuilding = null;
        int             buildRand        = 0;

        switch (rand)
        {
        case 0:
            buildRand        = Random.Range(0, bathroomList.Count);
            selectedBuilding = bathroomList[buildRand] as VisitorBuilding;
            break;

        case 1:
            buildRand        = Random.Range(0, exhibitBuildingList.Count);
            selectedBuilding = exhibitBuildingList[buildRand] as VisitorBuilding;
            break;
        }
        selectedBuilding.StartOutfitCountdown(outfit);
    }
Пример #10
0
 public void StartOutfitCountdown(OutfitList outfitNeeded)
 {
     currentOutfitNeeded = outfitNeeded;
     buildingActivated.SetActive(true);
 }