Thomas changed the topic of #kspmodding to: Welcome to #kspmodding - the channel for discussing, and learning about, modding Kerbal Space Program. Code of Conduct: https://git.io/vSQh6 | Always provide logs. | *** PSA: https://kerbalspaceprogram.com/api/index.html | <Red5> Guy was asked for a log file, he gave this link: http://pastebin.com/wfVarZPf | If you haven't read it yet: Logs :P
NathanKell is now known as NathanKell|AFK
ve2dmn has quit [Ping timeout: 186 seconds]
ve2dmn has joined #kspmodding
Pap|AFK is now known as Pap
blowfish has joined #kspmodding
VITAS has quit [Ping timeout: 204 seconds]
VITAS has joined #kspmodding
regex has joined #kspmodding
regex has quit [Remote host closed the connection]
Pap has quit [Read error: Connection reset by peer]
Pap has joined #kspmodding
NathanKell|AFK is now known as NathanKell|AWAY
blowfish has quit [Quit: Leaving]
smoke_fumus has joined #kspmodding
smoke_fumus has quit [Client Quit]
riocrokite has joined #kspmodding
<TheKosmonaut>
taniwha: are you present?
smoke_fumus has joined #kspmodding
<Sigma88>
hi there, I have an efficiency question for code
<Sigma88>
if I have a List<> with a bunch of elements
<Sigma88>
and I want to pick the best one following a set of rules
<Sigma88>
what would be the most efficient way to do that?
<Sigma88>
specifically
<Sigma88>
let's say I have a list of objects with 5 different properties
<Sigma88>
and I want to find the object that shares the most properties with the input
<Sigma88>
so, if one matches all 5 output that one
<riocrokite>
maybe this might be helpful or will lead you somewhere
<Sigma88>
thanks
<Sigma88>
nah that's simple .Where stuff
<Sigma88>
I know how to get the filter itself
<Sigma88>
my problem is, I assume whenever I do a .Where a new list is generated
<Sigma88>
so the memory gets filled with a lot of crap
<Sigma88>
possibly
<Sigma88>
I'm not really a big expert on this
ferram4 has quit [Ping timeout: 204 seconds]
<riocrokite>
yah
<Sigma88>
so, would it be best to go through myList with a foreach
<Sigma88>
and build an OutputList
<Sigma88>
including the best fit
<Sigma88>
and then output one at random from that list?
<Sigma88>
that's what I am currently doing
<Sigma88>
I go through every element, assign a "score" to the element, if the max score until that moment has been lower, I clean the output list, then set the maxscore to whatever score that element has, and add it to the outputlist