tuubes / TuubesCore

Scalable server engine for voxel / cubic games
http://tuubes.org
GNU Lesser General Public License v3.0
50 stars 5 forks source link

Actors-like messages for better concurrency and to allow distributed computing #21

Closed TheElectronWill closed 6 years ago

TheElectronWill commented 6 years ago

Proposal

Use messages to interact with entities and, why not, other parts of the system. For entities, I'm considering to restrict entity's interaction to a method call like this:

entity.msg(msgType, msgData)

// Shortcut like Akka?
entity ! (msgSource, msgType, msgData)

// Example:
val source = someEntity
val amount = someNumber
entity ! (source, Damage, amount)
TheElectronWill commented 6 years ago

Isn't it already done? See the org.tuubes.core.engine package.