Cj-bc / mcUI

This is Minecraft based 3D UI project!!!
2 stars 0 forks source link

refactoring: rewrite architecture with OOP #47

Open Cj-bc opened 5 years ago

Cj-bc commented 5 years ago

This project was based on OOP, but it's not completely accomplished. It's better to use only one paradigm, and OOP suits to this rather than Functional programming or others.

remove those funcs

and add

render should make diffs of states, and update blocks which was changed.

Cj-bc commented 5 years ago

logic to get diff

diff :: Session -> Session -> Session
diff prev new | prev == new = Session.empty()
               | _ = Session [ diffPane p n | p <- prev.panes , n <- new.panes ]

diffPane :: Pane -> Pane -> Pane
diffPane prev new | prev == new = Pane.empty()
                  | _ = Pane map diffEntry prev.entries new.entries
Cj-bc commented 5 years ago

WIP

Things to add

Cj-bc commented 5 years ago

THIS LOGIC MIGHT NOT WORK WHEN PANE IS MOVED I can set blocks for new Pane, but can’t remove previous blocks . I should think about this problem

Cj-bc commented 5 years ago

I add Diff class which holds plus/minus diffs

Cj-bc commented 5 years ago

diff関数の設計について

想定可能な実装方法

各方法のメリット・デメリット