3
/*sets up network for each level*/
4
void Network::setup() {
6
units = on (game.level);
7
for (i=0; i<units; i++)
8
if (!net.computers[i].setup(i)) {
14
ncables = game.MIN(game.level, units/2);
15
for (i=0; i<ncables; i++) cables[i].setup();
18
/*redraws the computers at their location with the proper image*/
19
void Network::draw () {
21
for (i=0; i<ncables; i++) cables[i].draw();
22
for (i=0; i<units; i++) computers[i].draw();
25
void Network::update () {
26
for (int i=0; i<ncables; i++) cables[i].update();
29
void Network::toasters () {
30
for (int i=0; i<units; i++) {
31
computers[i].type = computers[i].TOASTER;
32
computers[i].os = OS.OFF;
37
int Network::on(int lev) {
38
return game.MIN(8+lev, MAX_COMPUTERS);
41
void Network::load_pix () {
43
char *name[] = {"toaster", "maccpu", "nextcpu", "sgicpu", "suncpu",
45
for (i=0; i <= NUM_SYS; i++)
46
pictures[i].load(name[i]);
47
width = pictures[0].width;
48
height = pictures[0].height;