1 #include "reader/module.ih"
5 void Reader::readAlien(Alien
*alien
, std::streampos down
, std::streampos end
) {
6 std::streampos next
= down
;
7 if (next
== (std::streampos
)0) {
10 while (d_rider
.tellg() < end
) {
11 if (d_rider
.tellg() < next
) { // for some reason, this means its a piece (unstructured)
12 size_t len
= next
- d_rider
.tellg();
13 char *buf
= new char[len
];
14 d_rider
.read(buf
, len
);
15 AlienComponent
*comp
= new AlienPiece(buf
, len
);
16 alien
->getComponents().push_back(comp
);
17 } else { // that means we've got a store
19 AlienComponent
*comp
= new AlienPart(readStore());
20 alien
->getComponents().push_back(comp
);
21 next
= d_state
->next
> 0 ? d_state
->next
: end
;