Dilly
Dilly
CC#
Created by Dilly on 10/2/2023 in #help
❔ Comparing Types using local var Type type
gn
28 replies
CC#
Created by Dilly on 10/2/2023 in #help
❔ Comparing Types using local var Type type
sounds good, thank you for your help!
28 replies
CC#
Created by Dilly on 10/2/2023 in #help
❔ Comparing Types using local var Type type
looks like 2.1
28 replies
CC#
Created by Dilly on 10/2/2023 in #help
❔ Comparing Types using local var Type type
would there be an easy way to check my previous code for linq statements to refactor?
28 replies
CC#
Created by Dilly on 10/2/2023 in #help
❔ Comparing Types using local var Type type
I guess I could use a overridable var within the child classes to do the check instead of type checking if that would be safer / better for a game
28 replies
CC#
Created by Dilly on 10/2/2023 in #help
❔ Comparing Types using local var Type type
yes, would that be a big problem?
28 replies
CC#
Created by Dilly on 10/2/2023 in #help
❔ Comparing Types using local var Type type
well that was easy lol
28 replies
CC#
Created by Dilly on 10/2/2023 in #help
❔ Comparing Types using local var Type type
and the list is List<Item>...
28 replies
CC#
Created by Dilly on 10/2/2023 in #help
❔ Comparing Types using local var Type type
type in this case would be a class (ex: Helmet) which is a child of 'Item'
28 replies
CC#
Created by Dilly on 10/2/2023 in #help
❔ Comparing Types using local var Type type
private void DispType(Type type) {
foreach(var item in inventory) {
if (item is type) {
//Do stuff
}
}
}
private void DispType(Type type) {
foreach(var item in inventory) {
if (item is type) {
//Do stuff
}
}
}
28 replies