Added watch to allow optimistion

This commit is contained in:
Cooldude2606
2019-05-05 20:50:21 +01:00
parent 6b14fe9649
commit 34fcb94200
5 changed files with 96 additions and 14 deletions

10
expcore/store_test.lua Normal file
View File

@@ -0,0 +1,10 @@
local Store = require 'expcore.store'
Store.register('force.mining_speed','force',function(force)
return force.manual_mining_speed_modifier
end,function(force,value)
force.manual_mining_speed_modifier = value
game.print(force.name..' how has '..value..' mining speed')
end)
Store.watch('force.mining_speed','player')