mack
mack
CC#
Created by mack on 9/30/2024 in #help
✅ get set help
i dont understand the application of a get set method. are there any practical examples you can give?
12 replies
CC#
Created by mack on 9/28/2024 in #help
✅ array of methods
No description
13 replies
CC#
Created by mack on 9/25/2024 in #help
✅ enumeration help
can you call on the “index” of an entry in an enumeration? like say theres 3 options, red, blue, green, and i have an array with 1, 2, 3. if a random int is used to select between the array, can i also use that same random int to call upon the corresponding enumeration? i.e. red being called at the same time/in a similar way as 1, blue and 2, etc sorry if the question doesnt make sense, i can rephrase
14 replies
CC#
Created by mack on 5/21/2024 in #help
Finding Index of Dictionary Key
hey guys, just joined the server so forgive me if im not asking in the right place... please direct me elsewhere if this isnt the right area i am making an inventory system using a Dictionary<int, int> (key is for item ID, value is for how many of that item you have) and i was just curious about something:
if (GameDataManager.Instance.inv.ContainsKey(ID))
{
// get index of key ID
}
if (GameDataManager.Instance.inv.ContainsKey(ID))
{
// get index of key ID
}
does that make sense? i want to know if ID is already in inv so that, if it is, i add 1 to the value, and if not, i Add() the ID
6 replies