In my RPG I want to use a List Checking System to evaluate if a player possesses a specific item(s) needed to perforrm a specific action (ie: unlock a door). This checking is at the core of every action a player can perform.
Everything for the player is stored in a single inventory list to include attributes, skills, weapons, items, etc. This is the GIVE List. Every Game Control (Trigger/ Player Control / Gui Button) has a list of required item(s) needed to activate. This is the TAKE List.
Items in both Lists could be stored as Strings. The GIVE List item contains name & value. The TAKE List item contains logic condition {>, <, <>, <=, =>, =}, name & value.
When a player attempts to activate a control, items in the GIVE list are compared to the items TAKE list. First the items are checked to see if they exist, than compared using the logic condition. Each check results in a TRUE or FALSE. If all items checks = TRUE, the action is executed. If any item check = FALSE, the action is aborted.
The GIVE list can get pretty hefty in size requiring hundred of item checks. Thus, I' m looking for the most efficient means to store items (data structure) and evaluate the list (sort algorithm).
Everything for the player is stored in a single inventory list to include attributes, skills, weapons, items, etc. This is the GIVE List. Every Game Control (Trigger/ Player Control / Gui Button) has a list of required item(s) needed to activate. This is the TAKE List.
Items in both Lists could be stored as Strings. The GIVE List item contains name & value. The TAKE List item contains logic condition {>, <, <>, <=, =>, =}, name & value.
When a player attempts to activate a control, items in the GIVE list are compared to the items TAKE list. First the items are checked to see if they exist, than compared using the logic condition. Each check results in a TRUE or FALSE. If all items checks = TRUE, the action is executed. If any item check = FALSE, the action is aborted.
The GIVE list can get pretty hefty in size requiring hundred of item checks. Thus, I' m looking for the most efficient means to store items (data structure) and evaluate the list (sort algorithm).