danbuis / ArmadaAIEngineNew

Revisit of an old project to create an AI for Star Wars Armada
1 stars 0 forks source link

Defense Token tostring() ~~and equals()~~ #68

Open boredompwndu opened 3 years ago

boredompwndu commented 3 years ago

Requirements

It is not immediately clear in debugging the current status/type of tokens.

create a .toString() that tells the status and type of squadron

create a .equals() that checks the status/type of token of itself against a theoretically different token. (This likely has 0 use cases I just want to punch both of these out together and not think about it again later)

Potential Solutions

see above

Potential Tasks

What does it take to call this issue complete?

Create toString()

Create equals(){DefenseToken.other}

danbuis commented 3 years ago

I'm not sure I like the idea of overriding equals. I don't know that I want the 2 brace tokens on a neb to be equal to each other, even if they are both green. Feels like a case of YAGNI. You ain't gonna need it. I know its cheap and easy to do, but I just wanted to bring it up.

I'm not pushing back hard enough to say don't do it though. I can't imagine a scenario where I'm checking equality anyway, so its likely harmless.

boredompwndu commented 3 years ago

I feel obligated to point out that if you try to do (token == otherToken) you always get false because == on nonprimitives checks memory addresses. a .equals(other) will can be defined for equality. Same team on yagni though, so striking it from the issue