public bool HasItem(Item item) { if (item == null) { return(true); } return(Inventory.Exists(inventoryItem => inventoryItem.Details.ID == item.ID)); }
// Check if there is a item required to enter and checks if the player has this item public bool HasRequiredItemToEnterLocation(ILocation location) { if (location.ItemRequiredToEnter == null) { return(true); } return(Inventory.Exists(inventoryItem => inventoryItem.Item.ID == location.ItemRequiredToEnter.ID)); }
public bool HasRequiredItemToEnterThisLocation(Location location) { if (location.ItemRequiredToEnter == null) { return(true); } return(Inventory.Exists(ii => ii.Details.ID == location.ItemRequiredToEnter.ID)); }
public bool HasRequiredItemToEnterThisLocation(Location location) { if (location.ItemRequiredToEnter == null) { return(true); } // See if the player has the required item in their inventory return(Inventory.Exists(ii => ii.Details.ID == location.ItemRequiredToEnter.ID)); }
/*Inventory & Inventory Information * ==================================*/ public bool HasRequiredItemToEnterThisLocation(Location location) { if (location.ItemRequiredToEnter == null) { // There is no required item for this location, so return "true" return(true); } return(Inventory.Exists(inventoryItem => inventoryItem.Details.ID == location.ItemRequiredToEnter.ID)); }
public bool HasRequiredItemToEnterThisLocation(Location location) { if (location.ItemRequiredToEnter == null) { //no required item for this location, return true return(true); } //see if the player has required item in inv return(Inventory.Exists(ii => ii.Details.ID == location.ItemRequiredToEnter.ID)); }
public bool HasRequiredItemToEnterThisLocation(Location location) { if (location.ItemRequiredToEnter == null) { // There is no required item for this location, so return "true" return(true); } // We didn't find the required item in their inventory, so return "false" return(Inventory.Exists(ii => ii.Details.ID == location.ItemRequiredToEnter.ID)); }
public bool HasAllQuestCompletionItems(Quest quest) { foreach (QuestCompletionItem qci in quest.QuestCompletionItems) { if (!Inventory.Exists(ii => ii.Details.ID == qci.Details.ID && ii.Quantity == qci.Quantity)) { return(false); } } return(true); }
public bool HasRequiredItemToEnterThisLocation(Location location) { if (location.ItemRequiredToEnter == null) { // There is no required item for this location, so return "true" return(true); } // See if the player has the required item in their inventory return(Inventory.Exists(x => x.Item.ID == location.ItemRequiredToEnter.ID)); }
public bool HasRequiredItemToEnterThisLocation(Location location) { if (location.ItemRequiredToEnter == null) { // No hay requisitos para entrar en la ubicación, así que devolvemos true return(true); } // Comprueba si el jugador tiene el objeto que se requiere para entrar return(Inventory.Exists(ii => ii.Details.ID == location.ItemRequiredToEnter.ID)); }
public bool HasRequiredItemToEnterThisLocation(Location location) { if (location.ItemRequiredToEnter == null) { // Для доступа к локации не нужно иметь какого-либо предмета return(true); } // Проверить, имеется ли у игрока необходимый предмет return(Inventory.Exists(ii => ii.Details.ID == location.ItemRequiredToEnter.ID)); }
// See if the player has all the items needed to complete the quest here // Check each item in the player's inventory, to see if they have it, and enough of it // If we got there, then the player must have all the required items, and enough of them, to complete the quest. public bool HasAllQuestCompletionItems(IQuest quest) { foreach (IQuestCompletionItem questCompletionItem in quest.QuestCompletionItems) { if (!Inventory.Exists(inventoryItem => inventoryItem.Item.ID == questCompletionItem.Item.ID && inventoryItem.Quantity >= questCompletionItem.Quantity)) { return(false); } } return(true); }
public bool HasAllQuestCompletionItems(Quest quest) { // See if the player has all the items needed to complete the quest here foreach (QuestCompletionItem qci in quest.QuestCompletionItems) { if (!Inventory.Exists(ii => ii.Details.ID == qci.Details.ID && ii.Quantity >= qci.Quantity)) { return(false); } } // If we got here, then the player must have all the required items, and enough of them, to complete the quest. return(true); }
public bool HasAllQuestCompletionItems(Quest quest) { foreach (QuestCompletionItem qci in quest.QuestCompletionItems) { //Return false if the player doesn't have the item or if they have the item, but not enough if (!Inventory.Exists(ii => ii.Details.ID == qci.Details.ID && ii.Quantity > qci.Quantity)) { return(false); } } return(true); }
public bool HasAllQuestCompletionItems(Quest quest) { // Check each item in the player's inventory, to see if they have it, and enough of it foreach (QuestCompletionItem completionItem in quest.QuestCompletionItems) { if (!Inventory.Exists(inventoryItem => inventoryItem.Details.ID == completionItem.Details.ID && inventoryItem.Quantity >= completionItem.Quantity)) { return(false); } } // If we got here, then the player must have all the required items, and enough of them, to complete the quest. return(true); }
public bool IsQuestFulfilled(Quest quest) { List <QuestItem> requiredItems = quest.RequiredItems; foreach (QuestItem requiredItem in requiredItems) { bool hasRequiredItem = Inventory.Exists(inventoryItem => inventoryItem.Details.ID == requiredItem.Details.ID && inventoryItem.Quantity >= requiredItem.Quantity); if (!hasRequiredItem) { return(false); } } return(true); }
public bool HasAllQuestCompletionItems(Quest quest) { // Проверить, имеются ли необходимые для выполнения квеста предметы foreach (QuestCompletionItem qci in quest.QuestCompletionItems) { if (!Inventory.Exists(ii => ii.Details.ID == qci.Details.ID && ii.Quantity >= qci.Quantity)) { return(false); } } // Необходимые предметы и необходимое их количество имеется для выполнения квеста return(true); }
public bool HasAllQuestCompletionItems(Quest quest) { //see if player has all items needed to complete quest here foreach (QuestCompletionItem qci in quest.QuestCompletionItems) { //check each item in inventory if they have it and enough of it if (!Inventory.Exists(ii => ii.Details.ID == qci.Details.ID && ii.Quantity >= qci.Quantity)) { return(false); } } //if here, player had all required items and enough of them to complete quest. return(true); }
public bool HasAllQuestCompletionItems(Quest quest) { //Query list of QuestCompletionItems and compare items to condition below foreach (QuestCompletionItem qci in quest.QuestCompletionItems) { //Cheack that the quest completion item currently looping is in the Player Inventory and whether they have enough of it if (!Inventory.Exists(ii => ii.Details.ID == qci.Details.ID && ii.Quantity >= qci.Quantity)) { return(false); } } //If we got here, then the player must have all the required items, and enough of them, to complete the quest return(true); }
public bool HasAllQuestCompletionItems(Quest quest) { // See if the player has all the items needed to complete the quest here foreach (QuestCompletionItem qci in quest.QuestCompletionItems) { // Check each item in the player's inventory, to see if they have it, and enough of it if (!Inventory.Exists(ii => ii.Details.ID == qci.Details.ID && ii.Quantity >= qci.Quantity)) { return(false); } } // if we are here, the player must have all the items needed return(true); }
public bool HasAllQuestCompletionItems(Quest quest) { // See if the player has all the items needed to complete the quest here foreach (FinishedQuest finishedQuest in quest.FinishedQuests) { // Check each item in the player's inventory, to see if they have it, and enough of it if (!Inventory.Exists(i => i.Item.ID == finishedQuest.Item.ID && i.Quantity >= finishedQuest.Quantity)) { return(false); } } // If we got here, then the player must have all the required items, and enough of them, to complete the quest. return(true); }
public bool HasAllQuestCompletionItems(Quest quest) { // Comprueba si el jugador tiene todos los objetos para completar la misión foreach (QuestCompletionItem qci in quest.QuestCompletionItems) { // LINQ comprobando el inventario y luego la cantidad de objetos de quests // Si no tiene el objeto o no en el número necesario, devuelve false. if (!Inventory.Exists(ii => ii.Details.ID == qci.Details.ID && ii.Quantity >= qci.Quantity)) { return(false); } } // Si el jugador tiene el item y además en la cantidad correcta para completar la misión return(true); }