Wednesday, November 16, 2016

AbiathRPC - Watchdog planes

A very important part of AbiathRPC is the ability to detect changes. Today I started working on making that possible. I could have patched the view state class at runtime like I did the state manager, but I'd prefer to avoid reflection if possible. Render planes are always notified of changes, so a bunch of invisible dummy planes ought to do the trick. I added a stop for the event appropriate bus that injects those few render planes (one for each real plane, plus one that's only hit when the entire level is marked dirty).

The new watchdog plane class notifies the controller extension when a tile change is made or when the whole plane is invalidated. I've added an event listener for the main view's painting; that will be when the batched updates are delivered to the server. Waiting until a visual refresh can be done guarantees that the last tool finished whatever it was in the middle of doing when the planes were notified of the changes.

No comments:

Post a Comment