ADG Lua 

ADG Lua Commit Details

Date:2013-03-21 10:59:52 (6 years 8 months ago)
Author:Nicola Fontana
Branch:master
Commit:dfa697d36a942f66f42a5c22ec11ca194d51e0d0
Parents: 4e851bbaec07fcc540bc3b3425844667852d23c0
Message:adg-demo: improved docs on regenerate()

Changes:
Mpiston.lua (1 diff)

File differences

piston.lua
5252
5353
5454
55
56
57
58
59
60
61
5562
5663
57
64
5865
5966
6067
local constructor = {}
-- Inject the regenerate method into Adg.Model
--
-- Rebuilding the model *without* destroying it is the quickest method
-- to change a drawing: the notification mechanism will change only the
-- entities that effectively need to be modified.
--
-- Another (easier) option would be to regenerate everything - that is
-- models and views - from scratch.
rawset(Adg.Model, 'regenerate', function (model, part)
-- Call the original constructor of model, registered during the first call
-- of the same constructor, to regenerate it with the data stored in part.
-- to the same constructor, to regenerate it with the data stored in part.
constructor[model](part, model)
end)

Archive Download the corresponding diff file

Branches

Tags