insertion pushes, split position tests

This commit is contained in:
Torsten Ruger
2018-06-06 10:19:18 +03:00
parent c22aff4c4f
commit 7fa8397b56
7 changed files with 155 additions and 136 deletions

View File

@ -69,10 +69,17 @@ module Risc
return int if int == self.at
Position.set_to(self , int)
@at = int
trigger(:position_changed , self )
trigger_changed
int
end
# helper to fire the event that the position changed
# Note: set checks if the position actually has changed, before fireing
# but during insert it is helpful to trigger just to set the next
def trigger_changed
trigger(:position_changed , self )
end
def trigger_inserted
event_table[:position_changed].each { |handler| handler.position_inserted( self) }
end