Name: Anonymous 2008-03-11 22:17
So Im learning GTK-2.0.
And I want to make a train simulator.
Im moddeling the track/stations as a directed graph.
The user creates vertecies(stations).
Then makes an edge(track section) by clicking two stations.
Then makes rail lines(paths) by connecting edges of track.
I decided to store the stations, information in a mysql database cause its better than a flat filesystem.
so im doing this in GTK-2.0 with objective C and im thinking a UI using windows like below:
|=View======================| |=Stations==================|
| | | |
| 1o Chester | | 1) London |
| \ | | 2) Birmingham |
| \ | | 3) Chester |
| 2o Birmingham | | |
| | | |===========================|
| | |
| | | |=Edges=====================|
| 3o London | | 1) (3,2) |
| | | 2) (2,1) |
| | | 3) (1,2) |
| | | 4) (2,3) |
|===========================| |===========================|
|=Lines=====================|
| |
| oop north railways[1,2] |
| dahn sahf line[3,4] |
| |
|===========================|
The windows (Stations,Lines,Edges) should reflect whats in the database. So that making/deleting track pieces causes an insert/delete statement to occur on the database.
also it would be nice to allow the edges window access to see what the content of the stations window is.
ANYWAY. My question is. I would normally make a base class PieceEditor, handles contacting the database and creating the window, then I'd derive StationEditor,EdgeEditor,VertexEditor from PieceEditor.
how do I do this in objective C?
Ive been using inheritance for too long!
And I want to make a train simulator.
Im moddeling the track/stations as a directed graph.
The user creates vertecies(stations).
Then makes an edge(track section) by clicking two stations.
Then makes rail lines(paths) by connecting edges of track.
I decided to store the stations, information in a mysql database cause its better than a flat filesystem.
so im doing this in GTK-2.0 with objective C and im thinking a UI using windows like below:
|=View======================| |=Stations==================|
| | | |
| 1o Chester | | 1) London |
| \ | | 2) Birmingham |
| \ | | 3) Chester |
| 2o Birmingham | | |
| | | |===========================|
| | |
| | | |=Edges=====================|
| 3o London | | 1) (3,2) |
| | | 2) (2,1) |
| | | 3) (1,2) |
| | | 4) (2,3) |
|===========================| |===========================|
|=Lines=====================|
| |
| oop north railways[1,2] |
| dahn sahf line[3,4] |
| |
|===========================|
The windows (Stations,Lines,Edges) should reflect whats in the database. So that making/deleting track pieces causes an insert/delete statement to occur on the database.
also it would be nice to allow the edges window access to see what the content of the stations window is.
ANYWAY. My question is. I would normally make a base class PieceEditor, handles contacting the database and creating the window, then I'd derive StationEditor,EdgeEditor,VertexEditor from PieceEditor.
how do I do this in objective C?
Ive been using inheritance for too long!