Closed richelbilderbeek closed 5 years ago
It is used in saving and loading and is an inportant part of making the game work on incorrect save files (for when people try to mod the game)
Op vr 22 mrt. 2019 18:52 schreef Richel Bilderbeek <notifications@github.com
:
Is your feature request related to a problem? Please describe.
I've never observed a use of a null-type agent_type.
Take for example this line:
agent nearest_f(agent_type::none, INFINITY, INFINITY);
The line above indicates that no agent is yet found,
A superior way to indicate the same:
std::vector
nearest_agent; Drawback of the current approach are abominations like this:
//An agent of type none is used when a 'null' agent is needed assert(type != agent_type::none || type == agent_type::none);
I suggest to do ourselves a favour and remove agent_type::none.
Describe the solution you'd like
Remove agent_type::none. When a null-agents is needed, use an empty std::vector
instead. Describe alternatives you've considered
None.
Additional context
None.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/richelbilderbeek/djog_unos_2018/issues/512, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab-TktRoOZsRsvtdlAl3_ngdsnRIWkLCks5vZRhmgaJpZM4cEHH- .
Replace the usages with a cow
Well done @AramPetiet, but it did break the build due to OCLint.
Address the OCLint feedback, then push again, then move this Issue in 'To be merged with develop' :+1:
Is your feature request related to a problem? Please describe.
I've never observed a use of a null-type
agent_type
.Take for example this line:
The line above indicates that no agent is yet found,
A superior way to indicate the same:
Drawback of the current approach are abominations like this:
I suggest to do ourselves a favour and remove
agent_type::none
.Describe the solution you'd like
Remove
agent_type::none
. When a null-agents is needed, use an emptystd::vector<agent>
instead.Describe alternatives you've considered
None.
Additional context
None.