I'm banging my head over this one but there's got to be an easy answer!
I have a library of books. Each book has simple types: string sTitle, string sAuthor, boolean bIsHardback
but a book also has a number of pages. A page must exist(there may be >1) and pages need a number of simple types: string sPageText, boolean bHasImage.
My logic says this works:
Expand|Select|Wrap|Line Numbers
- class APage
- { // A single page
- public boolean bHasImages;
- public string sPageText;
- }
- class ABook
- { // Object to hold pages
- string sTitle;
- string sAuthor;
- boolean bIsHardback;
- APage[] BookPages;
- }
Expand|Select|Wrap|Line Numbers
- APage()
- {
- APage[]=new APage[1];
- }