Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Support Entities for Create & Destruct commands. | cc900579eedf9c6288ce1c1883122856794e05a0 | Jan Allersma | 2018-11-02 13:25:43 |
Use entities instead of shapes when constructing ornaments. | 13f08847624489f60a37db55c2aedbba6b021f98 | Jan Allersma | 2018-11-01 17:02:47 |
Remove obsolete 'calcBounds' function. | 475ec330736b5800d12d091415480b163dd244e2 | Jan Allersma | 2018-11-01 14:28:29 |
Setup for decorator pattern. | 762914dec31b1fb1d4cf6bb0cef2e148010652a4 | Jan Allersma | 2018-11-01 14:12:51 |
Revert commit '5678eb6'. | 6225242719b2cfc5ee0de9f8d05edbc7a69007a7 | Jan Allersma | 2018-11-01 14:10:27 |
Make groups movable and resizable. | 1ca7c18ab103a8d1055b27f63192038fd75aef3e | Jan Allersma | 2018-10-17 14:51:32 |
Use translations instead of positions for moving shapes. | 9551c7d2608f01c3950743fd97bd217aab8f5766 | Jan Allersma | 2018-10-16 16:11:03 |
Implement Visitor pattern for Groups. | bd30477ce616362d3f58cef072d1ebc78077fa85 | Jan Allersma | 2018-10-16 13:28:37 |
Implement Visitor pattern for Shapes. | e52412c3059c1ee5fa9abdf4a32db0f47981eee1 | Jan Allersma | 2018-10-16 12:43:17 |
Setup 'Decorator' and 'Ornament' class. | 5678eb6257bcf88502078d08395a394a1c24568b | Jan Allersma | 2018-10-09 09:29:50 |
Use different strats instead of seperate Shapes. | a56e1e665a0292d15139eddfd8ebdeb8c95251b4 | Jan Allersma | 2018-10-01 11:37:45 |
Make ornament interface compatible with Entities. | 21383d5f200a338f8255d7d33b6989937c19fed6 | Jan Allersma | 2018-10-08 20:36:23 |
Fix bug in Rect from commit 6c91140 in other Shapes as well. | 4165a5da98dd9a548a222c6160390e4e54026d48 | Jan Allersma | 2018-09-28 14:53:40 |
Build interface for ornament creation. | adcf22a4e878edc45ac0775a5e15ebf0bb1a937d | Jan Allersma | 2018-10-08 13:53:52 |
Fully implement File I/O. | 45cbb48489a24857cfc76144b38b12ccebfd9e61 | Jan Allersma | 2018-09-27 16:03:40 |
Fix GroupMenu bug. | be41e51819be1a23e7761ea0662eb188ac641aca | Jan Allersma | 2018-09-27 14:55:20 |
Fix TODO's from previous commit. | 89d8172b77336a6c18f30521147eb81287961f11 | Jan Allersma | 2018-09-27 14:06:30 |
Add groups as preparation for step 3. | a91368128e7444f69b3a30ee4d17f9063c8846b8 | Jan Allersma | 2018-09-26 18:31:49 |
Fix minor bug. Small cleanup 'ellipse' code. | 6c911405eb8e48ffe2d63aaff5255adbd4aec889 | Jan Allersma | 2018-09-21 18:10:01 |
Implement file I/O. | 6219eca932d454a7dab5fe8679f07865ce3cf49d | Jan Allersma | 2018-09-21 15:52:45 |
File | Lines added | Lines deleted |
---|---|---|
source/commands/create.d | 10 | 10 |
source/commands/destruct.d | 8 | 8 |
source/frontend/ornamentDialog.d | 3 | 0 |
File source/commands/create.d changed (mode: 100644) (index 335545b..70e6e79) | |||
1 | 1 | module dp.command.create; | module dp.command.create; |
2 | 2 | ||
3 | 3 | import dp.command.cmd; | import dp.command.cmd; |
4 | import dp.ent.shape; | ||
4 | import dp.ent.entity; | ||
5 | 5 | import dp.visitor.save; | import dp.visitor.save; |
6 | 6 | ||
7 | 7 | import Global = dp.global; | import Global = dp.global; |
8 | 8 | ||
9 | 9 | public class CreateCmd : Command { | public class CreateCmd : Command { |
10 | private Shape s; | ||
10 | private Entity e; | ||
11 | 11 | ||
12 | this(Shape shape) { | ||
13 | s = shape; | ||
12 | this(Entity entity) { | ||
13 | e = entity; | ||
14 | 14 | execute(); // Obsolete, but remained for consistency between 'Command' classes. | execute(); // Obsolete, but remained for consistency between 'Command' classes. |
15 | 15 | } | } |
16 | 16 | ||
17 | 17 | public override void execute() { | public override void execute() { |
18 | s.active = true; | ||
18 | e.active = true; | ||
19 | 19 | } | } |
20 | 20 | ||
21 | 21 | public override void undo() { | public override void undo() { |
22 | s.active = false; | ||
22 | e.active = false; | ||
23 | 23 | } | } |
24 | 24 | ||
25 | 25 | public override void render() { | public override void render() { |
26 | s.render(); | ||
26 | e.render(); | ||
27 | 27 | } | } |
28 | 28 | ||
29 | 29 | public override void check(int x, int y) { | public override void check(int x, int y) { |
30 | s.checkBounds(x,y); | ||
30 | e.checkBounds(x,y); | ||
31 | 31 | } | } |
32 | 32 | ||
33 | 33 | // Should be done by Visitor self. | // Should be done by Visitor self. |
34 | 34 | public override void save(Savefile file) { | public override void save(Savefile file) { |
35 | if(s.group !is null) | ||
36 | s.accept(new SaveVisitor(file)); | ||
35 | if(e.group !is null) | ||
36 | e.accept(new SaveVisitor(file)); | ||
37 | 37 | } | } |
38 | 38 | } | } |
File source/commands/destruct.d changed (mode: 100644) (index 84596e7..547e012) | |||
1 | 1 | module dp.command.destruct; // don't use 'dp.command.delete' as module. Causes bug. | module dp.command.destruct; // don't use 'dp.command.delete' as module. Causes bug. |
2 | 2 | ||
3 | 3 | import dp.command.cmd; | import dp.command.cmd; |
4 | import dp.ent.shape; | ||
4 | import dp.ent.entity; | ||
5 | 5 | ||
6 | 6 | import Global = dp.global; | import Global = dp.global; |
7 | 7 | ||
8 | 8 | public class DestructCmd : Command { | public class DestructCmd : Command { |
9 | private Shape s; | ||
9 | private Entity e; | ||
10 | 10 | ||
11 | this(Shape shape) { | ||
12 | s = shape; | ||
11 | this(Entity entity) { | ||
12 | e = entity; | ||
13 | 13 | execute(); | execute(); |
14 | 14 | } | } |
15 | 15 | ||
16 | 16 | public override void execute() { | public override void execute() { |
17 | s.active = false; | ||
17 | e.active = false; | ||
18 | 18 | } | } |
19 | 19 | ||
20 | 20 | public override void undo() { | public override void undo() { |
21 | s.active = true; | ||
21 | e.active = true; | ||
22 | 22 | } | } |
23 | 23 | ||
24 | 24 | public override void render() { | public override void render() { |
25 | s.render(); | ||
25 | e.render(); | ||
26 | 26 | } | } |
27 | 27 | ||
28 | 28 | public override void check(int x, int y) { | public override void check(int x, int y) { |
29 | s.checkBounds(x,y); | ||
29 | e.checkBounds(x,y); | ||
30 | 30 | } | } |
31 | 31 | } | } |
File source/frontend/ornamentDialog.d changed (mode: 100644) (index 44a440d..f5ab652) | |||
... | ... | import gtk.Box; | |
11 | 11 | import dp.ent.entity; | import dp.ent.entity; |
12 | 12 | import dp.ent.ornament; | import dp.ent.ornament; |
13 | 13 | import dp.dec.entornament; | import dp.dec.entornament; |
14 | //import dp.command.create; | ||
14 | 15 | ||
15 | 16 | import Global = dp.global; | import Global = dp.global; |
16 | 17 | ||
... | ... | class OrnamentDialog : Dialog { | |
79 | 80 | this.close(); | this.close(); |
80 | 81 | ||
81 | 82 | if(input != "") { | if(input != "") { |
83 | //Ornament o = new Ornament(e, position, input); | ||
84 | //Global.History.addCommand(new CreateCmd(o)); | ||
82 | 85 | eo.setOrnament(new Ornament(e, position, input)); | eo.setOrnament(new Ornament(e, position, input)); |
83 | 86 | //e = eo; | //e = eo; |
84 | 87 | this.close(); | this.close(); |