#Searching an array for a resource with specific variable values

1 messages · Page 1 of 1 (latest)

hollow trellis
#

TLDR: Can I search an array of resources to select a resource that has multiple specific variable values?

I'm working on a pet adoption puzzle game, where you are given a daily list of pets to home, and a daily list of families applying to adopt pets. The player needs to identify the needs of a pet and then find a family that can meet these needs. Both the pets and the families are resources, and they are in separate arrays. At the start of the day, the pet array is randomized and the player is presented with a set number of pets, which are removed from the array so that they do not show up again later. I now want to select families from their array that specifically meet the needs of the pets assigned by the previous code. There are variable needs in the pet class, and variables that determine a family's ability to meet those needs in the family class. How can I search an array for a resource with multiple specific variable values?

deep cargo