oakmound / oak

A pure Go game engine
Apache License 2.0
1.53k stars 83 forks source link

Change event.CID to an alias of int. #137

Closed lolbinarycat closed 3 years ago

lolbinarycat commented 3 years ago

Instead of type CID int have type CID = int. The reason for this is of course the fact that they are use pretty much interchangeably throughout the code.

Implausiblyfun commented 3 years ago

I do admit that the whole int versus CID thing is pretty annoying. However due to the existence of https://github.com/oakmound/oak/blob/master/event/cid.go#L18 its probably something to revisit with the push to 3.0

lolbinarycat commented 3 years ago

I'm not 100% sure what you're saying, but if oak was changed to only ever use CID and never int, there would be no need for this change.

200sc commented 3 years ago

Taking this issue in isolation-- to clarify: there are methods on CID, so it can't be an alias as you can't add methods to built in types.

Using CID more often is a preferable approach.

lolbinarycat commented 3 years ago

Yeah, that makes sense.