kapstok / NHL-DePa2 (public) (License: Unspecified) (since 2018-11-09) (hash sha1)
Design Patterns school project; a GUI using multiple Design Patterns.
List of commits:
Subject Hash Author Date (UTC)
Change Entity.group as variable into a property. bbda7fe1dd4528b9396bff03fcb669e4c6ff2ad5 Jan Allersma 2018-11-08 16:37:41
Load nested Entities with Ornaments properly. 8da015e6fd4f43cc873a5ae330caefab73b8f5fc Jan Allersma 2018-11-08 13:56:36
Save nested Entities with Ornaments properly. 645cf4ae287fd2511b4c1404d0d9559372e5e10b Jan Allersma 2018-11-08 12:04:40
Fix bug: activate group after movement with cloning. 482c53ecab43cdee03590949669c22227d104475 Jan Allersma 2018-11-08 10:35:27
Include Groups in Commands, removing dp.groups.groups. 699f767ac316edd481630a943f7a1884c5bc16f2 Jan Allersma 2018-11-07 11:27:15
Fix ability to nest in Groups. fd546a42ef54bdf5d2966eb7facbbf21a6b72e1b Jan Allersma 2018-11-06 17:49:11
Fix file I/O for single entities. 093b7d31a215067212927b1d92bdbbee306ea345 Jan Allersma 2018-11-06 16:49:55
Fix file I/O issue. 25c0b40db223c806eb3ea8bd28238dedc38ca8b5 Jan Allersma 2018-11-02 16:22:59
Cleanup commenting. 445aea4a5115c9110a097bfc7ac9f7d5ad48a9e7 Jan Allersma 2018-11-02 14:33:08
Show Ornaments on Canvas. d8456f15d69550c4cb0aa615cccb96b45a77f6a6 Jan Allersma 2018-11-02 14:08:47
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
Commit bbda7fe1dd4528b9396bff03fcb669e4c6ff2ad5 - Change Entity.group as variable into a property.
After loading a file, the Groups froze; they were unmovable.
This was due to Decorator.group being different than
Decorator.e.group. The Decorator now forwards the 'group'
property.
Author: Jan Allersma
Author date (UTC): 2018-11-08 16:37
Committer name: Jan Allersma
Committer date (UTC): 2018-11-08 16:43
Parent(s): 8da015e6fd4f43cc873a5ae330caefab73b8f5fc
Signing key:
Tree: 05f064d442fc97880a65e7ff94bb1c1605b53f7d
File Lines added Lines deleted
source/entities/decorator/decorator.d 10 0
source/entities/entity.d 6 1
source/entities/group.d 11 0
source/entities/ornament.d 10 1
source/entities/shape.d 11 0
File source/entities/decorator/decorator.d changed (mode: 100644) (index 71beec4..8bb1a04)
... ... abstract class Decorator : Entity {
10 10 e = entity; e = entity;
11 11 } }
12 12
13 @property
14 public override Group group() {
15 return e.group;
16 }
17
18 @property
19 public override Group group(Group g) {
20 return e.group = g;
21 }
22
13 23 @property @property
14 24 public override double size() { public override double size() {
15 25 return e.size; return e.size;
File source/entities/entity.d changed (mode: 100644) (index dfc215f..f1d10e7)
... ... import dp.ent.shape;
8 8
9 9 class Entity { class Entity {
10 10 public bool active = true; public bool active = true;
11 public Group group = null;
12 11 public Ornament ornament = null; public Ornament ornament = null;
13 12
13 @property
14 public abstract Group group();
15
16 @property
17 public abstract Group group(Group g);
18
14 19 @property @property
15 20 public abstract double size(); public abstract double size();
16 21
File source/entities/group.d changed (mode: 100644) (index da8d285..60196d2)
... ... class Group : Entity {
13 13 public double[3] colour; // R, G, B public double[3] colour; // R, G, B
14 14 private Entity[] entities; private Entity[] entities;
15 15 private double _size; private double _size;
16 private Group _group;
16 17
17 18 this() { this() {
18 19 _size = 1; _size = 1;
 
... ... class Group : Entity {
25 26 ]; ];
26 27 } }
27 28
29 @property
30 public override Group group() {
31 return _group;
32 }
33
34 @property
35 public override Group group(Group g) {
36 return _group = g;
37 }
38
28 39 @property @property
29 40 public override double size() { public override double size() {
30 41 return _size; return _size;
File source/entities/ornament.d changed (mode: 100644) (index cf58703..e11b12c)
... ... class Ornament : Entity {
14 14 this.alignment = alignment; this.alignment = alignment;
15 15 this.value = value; this.value = value;
16 16 this.context = context; this.context = context;
17 this.group = entity.group; // Redundant?
18 17 entity.ornament = this; entity.ornament = this;
19 18
20 19 context.setSourceRgba(0.5,0.5,0.5,1); context.setSourceRgba(0.5,0.5,0.5,1);
 
... ... class Ornament : Entity {
22 21 context.setFontSize(13); context.setFontSize(13);
23 22 } }
24 23
24 @property
25 public override Group group() {
26 return entity.group;
27 }
28
29 @property
30 public override Group group(Group g) {
31 return entity.group = g;
32 }
33
25 34 @property @property
26 35 public override double size() { public override double size() {
27 36 return entity.size; return entity.size;
File source/entities/shape.d changed (mode: 100644) (index 4073a93..037586c)
... ... class Shape : Entity {
19 19 private double[2][2] b; // bounds private double[2][2] b; // bounds
20 20 private double s; // size private double s; // size
21 21 private Strategy strat; private Strategy strat;
22 private Group g; // group
22 23
23 24 this(int x, int y, Context context, Strategy strategy, double size = 0) { this(int x, int y, Context context, Strategy strategy, double size = 0) {
24 25 c = context; c = context;
 
... ... class Shape : Entity {
28 29 bounds = [x,y]; bounds = [x,y];
29 30 } }
30 31
32 @property
33 public override Group group() {
34 return g;
35 }
36
37 @property
38 public override Group group(Group g) {
39 return this.g = g;
40 }
41
31 42 @property @property
32 43 public override string type() { public override string type() {
33 44 return strat.type; return strat.type;
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/kapstok/NHL-DePa2

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/kapstok/NHL-DePa2

Clone this repository using git:
git clone git://git.rocketgit.com/user/kapstok/NHL-DePa2

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main