// Returns true if the given location is the requested initial location of the given item public bool IsInitialLocation(string itemID, string locationID, LOCATION_POSITION locPos) { //return ItemExists(itemID, "IsInitialLocation") && LocationExists(locationID, "IsInitialLocation") && ItemDict[itemID].IsInitialLocation(locationID, locPos); if (ItemExists(itemID, "IsInitialLocation")) { bool isLocation1 = itemLookup[itemID].initialLocation == locationID; bool isLocation2 = itemLookup[itemID].initialLocation2 == locationID; bool outcome = false; switch (locPos) { case LOCATION_POSITION.EITHER_LOCATION: outcome = isLocation1 || isLocation2; break; case LOCATION_POSITION.FIRST_LOCATION: outcome = isLocation1; break; case LOCATION_POSITION.SECOND_LOCATION: outcome = isLocation2; break; } return(outcome); } return(false); }
// Returns the requested location of the given item public string Where(string itemID, LOCATION_POSITION position) { if (ItemExists(itemID, "Where")) { return(position == LOCATION_POSITION.SECOND_LOCATION ? ItemDict[itemID].CurrentLocation2 : ItemDict[itemID].CurrentLocation); } return(null); }