Adam
Structure of system with polymorphism
in
Cell
i have a PopulateCell
function that takes in a list of EntityData
and goes through and instantiates and initialises each Entity
with its EntityData
to load the world from a save
how do i differentiate between different EntityData
?
maybe make it abstract as well and have each Entity
have a different type of data, or maybe through an enum?21 replies
Making my functions more generic
oh and is there a similarly more performant way to implement this function? i haven't changed the Stat class to implement an interface yet so keep that in mind
i use the dict of stats i got from the other function and then take in another dict of stats that i want to add stats to, but only add them if the dict doesn't already have them
alternatively a way to do this innately without a function, i've looked for that but couldn't find a good solution
24 replies