コード例 #1
0
 public Locations(string aName,
                  ELocations aQLoc,
                  ELocations aWLoc,
                  ELocations aELoc,
                  Text[] aExplanation,
                  int aTravelTime = 1)
 {
     Name        = aName;
     QLoc        = aQLoc;
     WLoc        = aWLoc;
     ELoc        = aELoc;
     ALoc        = ELocations.NONE;
     SLoc        = ELocations.NONE;
     DLoc        = ELocations.NONE;
     Explanation = aExplanation;
     TravelTime  = aTravelTime;
 }
コード例 #2
0
        private Text GetLocationMessage(char selectionLetter, ELocations aLocation)
        {
            string prefix = $"[{selectionLetter}] - Go -> ";

            switch (aLocation)
            {
            case ELocations.DIAGON_ALLEY_SHOP:
                return(new Text(prefix + "Diagon Alley Shop Selector"));

            case ELocations.LEAKY_CAULDRON_SHOP:
                return(new Text(prefix + "Leaky Cauldron Bar"));

            //MORE SHOPS...
            default:
                var loc = myLocations[aLocation];
                return(new Text(prefix + loc.Name.Replace(
                                    loc.Name.Substring(0, loc.Name.IndexOf("-", StringComparison.OrdinalIgnoreCase) + 2),
                                    "")));
            }
        }
コード例 #3
0
 public Locations(string aName,
                  ELocations aQLoc,
                  ELocations aWLoc,
                  ELocations aELoc,
                  ELocations aALoc,
                  ELocations aSLoc,
                  ELocations aDLoc,
                  Text[] aExplanation,
                  int aTravelTime = 2)
 {
     Name        = aName;
     QLoc        = aQLoc;
     WLoc        = aWLoc;
     ELoc        = aELoc;
     ALoc        = aALoc;
     SLoc        = aSLoc;
     DLoc        = aDLoc;
     Explanation = aExplanation;
     TravelTime  = aTravelTime;
 }
コード例 #4
0
        /// <summary>
        /// Gets the correct action for the location, such as setting the <c>myCurrentLocation</c> to
        /// something and executing the explore code by returning true
        /// </summary>
        /// <param name="aRunLocation">
        /// The location you want to get the action of (Like exploring to).
        /// </param>
        /// <returns> if it should explore or not (It shouldnt explore if it isnt a location but a shop instead) </returns>
        private bool RunAction(ELocations aRunLocation)
        {
            switch (aRunLocation)
            {
            case ELocations.DIAGON_ALLEY_SHOP:
                myShopSelectors[ELocations.DIAGON_ALLEY_SHOP].OpenInventory(true);
                return(false);

            case ELocations.LEAKY_CAULDRON_SHOP:
                myShops[ELocations.LEAKY_CAULDRON_SHOP].OpenInventory(true);
                return(false);

            case ELocations.LEAKY_CAULDRON_APARTMENT_SHOP:
                myShops[ELocations.LONDON_LEAKYCAULDRON_APPARTMENTS].OpenInventory(true);
                return(false);

            case ELocations.NONE:
                return(false);

            default:
                myCurrentLocation = aRunLocation;
                return(true);
            }
        }