InteractiveScapeGmbH / TuioNet

MIT License
7 stars 1 forks source link

separate interfaces for tuio types #7

Closed eqbic closed 1 year ago

eqbic commented 1 year ago

Right now there is one tuiolistener interface for each tuio type (cursor, object, blob). one has to implement the whole interface even if only one type (e.g. cursors) are interesting. the idea is to split up the one interface into one for each tuio type. that makes the code on the client side much cleaner.

Right now:

public interface ITuio11Listener
{
    public void AddTuioObject(Tuio11Object tuio11Object);

    public void UpdateTuioObject(Tuio11Object tuio11Object);

    public void RemoveTuioObject(Tuio11Object tuio11Object);

    public void AddTuioCursor(Tuio11Cursor tuio11Cursor);

    public void UpdateTuioCursor(Tuio11Cursor tuio11Cursor);

    public void RemoveTuioCursor(Tuio11Cursor tuio11Cursor);

    public void AddTuioBlob(Tuio11Blob tuio11Blob);

    public void UpdateTuioBlob(Tuio11Blob tuio11Blob);

    public void RemoveTuioBlob(Tuio11Blob tuio11Blob);

    public void Refresh(TuioTime tuioTime);
} 

Idea:

public interface ITuio11CursorListener
{
    public void AddCursor(Tuio11Cursor cursor);
    public void UpdateCursor(Tuio11Cursor cursor);
    public void RemoveCursor(Tuio11Cursor cursor);
}
paul-peters commented 1 year ago

Good Idea, but keep the big Interface as well.

paul-peters commented 1 year ago

The issue was solved by: https://github.com/InteractiveScapeGmbH/TuioNet/pull/10