Answer Overflow Logo
Change Theme
Search Answer Overflow
GitHub
Add Your Server
Login
Home
Popular
Topics
Gaming
Programming
Zeke
Posts
Comments
C
C#
•
Created by Zeke on 3/8/2024 in
#help
Composition over Inheritance
Even if I'm using inheritance with composition side by side?
4 replies
C
C#
•
Created by Zeke on 3/8/2024 in
#help
Help with Generics
Fair enough. Appreciate the insight
25 replies
C
C#
•
Created by Zeke on 3/8/2024 in
#help
Help with Generics
I got scolded in a class once for using "-variable- is Type" and was told "use generics you silly goose" lol
25 replies
C
C#
•
Created by Zeke on 3/8/2024 in
#help
Help with Generics
The solution you linked is similar to my own non generic version, but I thought this was a perfect case for generics. I'm mostly trying to learn
25 replies
C
C#
•
Created by Zeke on 3/8/2024 in
#help
Help with Generics
Sort through anyway
25 replies
C
C#
•
Created by Zeke on 3/8/2024 in
#help
Help with Generics
So I needed to throw away stats like health : CharacterStat or attackspeed : CharacterStat
25 replies
C
C#
•
Created by Zeke on 3/8/2024 in
#help
Help with Generics
Not base classes
25 replies
C
C#
•
Created by Zeke on 3/8/2024 in
#help
Help with Generics
The initial list im passing in is full of inherited stats
25 replies
C
C#
•
Created by Zeke on 3/8/2024 in
#help
Help with Generics
25 replies
C
C#
•
Created by Zeke on 3/8/2024 in
#help
Help with Generics
And I save them as fields as their types
25 replies
C
C#
•
Created by Zeke on 3/8/2024 in
#help
Help with Generics
T and U are two separate inherited types
25 replies
C
C#
•
Created by Zeke on 3/8/2024 in
#help
Help with Generics
I updated my image sorry
25 replies
C
C#
•
Created by Zeke on 3/8/2024 in
#help
Help with Generics
Oh I messed up, T should be StatAttackRange (sorry!)
25 replies
C
C#
•
Created by Zeke on 3/8/2024 in
#help
Help with Generics
Yeah I have two potential stats inheriting from CharacterStat
25 replies