Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
navdrawlist Class Reference

#include <drawlist.h>

Public Member Functions

void insert (int type, float size, float x, float y)
 
void insert (int type, float size, float x, float y, Unit *source)
 
void wipe ()
 
void rotate ()
 
void draw ()
 
int get_n_contents ()
 
Unitgettailunit ()
 
 navdrawlist (bool mouse, navscreenoccupied *screenoccupation, GFXColor *factioncolours)
 
 ~navdrawlist ()
 

Public Attributes

float unselectedalpha
 

Detailed Description

Definition at line 58 of file drawlist.h.

Constructor & Destructor Documentation

navdrawlist::navdrawlist ( bool  mouse,
navscreenoccupied screenoccupation,
GFXColor factioncolours 
)

Definition at line 46 of file drawlist.cpp.

References unselectedalpha.

47 {
48  inmouserange = mouse;
49  head = NULL;
50  tail = NULL;
51  unselectedalpha = 0.8;
52  n_contents = 0;
53  screenoccupation = screenoccupation_;
54  localcolours = 0;
55  factioncolours = factioncolours_;
56 }
navdrawlist::~navdrawlist ( )

Definition at line 58 of file drawlist.cpp.

References wipe().

59 {
60  inmouserange = 0;
61  wipe();
62  head = NULL;
63  tail = NULL;
64  n_contents = 0;
65 }

Member Function Documentation

void navdrawlist::draw ( void  )

Definition at line 461 of file drawlist.cpp.

References drawlistitem(), navdrawnode::nextitem, navdrawnode::size, navdrawnode::source, navdrawnode::type, unselectedalpha, navdrawnode::x, and navdrawnode::y.

Referenced by NavigationSystem::DrawSystem().

462 {
463  if (head == NULL) {
464  return;
465  } else {
466  navdrawnode *current = head;
467  while (current != NULL) {
468  drawlistitem( current->type,
469  current->size,
470  current->x,
471  current->y,
472  current->source,
473  screenoccupation,
474  inmouserange,
475  current == tail,
477  factioncolours );
478 
479  current = current->nextitem;
480  }
481  }
482 }
int navdrawlist::get_n_contents ( )

Definition at line 67 of file drawlist.cpp.

Referenced by NavigationSystem::DrawSystem().

68 {
69  return n_contents;
70 }
Unit * navdrawlist::gettailunit ( )

Definition at line 173 of file drawlist.cpp.

References navdrawnode::source.

Referenced by NavigationSystem::DrawSystem().

174 {
175  return tail->source;
176 }
void navdrawlist::insert ( int  type,
float  size,
float  x,
float  y 
)

Definition at line 72 of file drawlist.cpp.

Referenced by NavigationSystem::DrawSystem().

73 {
74  if (head == NULL) {
75  head = new navdrawnode( type, size, x, y, NULL );
76  tail = head;
77  } else {
78  head = new navdrawnode( type, size, x, y, head );
79  }
80  n_contents += 1;
81 }
void navdrawlist::insert ( int  type,
float  size,
float  x,
float  y,
Unit source 
)

Definition at line 83 of file drawlist.cpp.

84 {
85  if (head == NULL) {
86  head = new navdrawnode( type, size, x, y, source, NULL );
87  tail = head;
88  } else {
89  head = new navdrawnode( type, size, x, y, source, head );
90  }
91  n_contents += 1;
92 }
void navdrawlist::rotate ( )

Definition at line 107 of file drawlist.cpp.

References navdrawnode::nextitem.

Referenced by NavigationSystem::DrawSystem().

108 {
109  if (head != NULL) {
110  //|
111  //|
112  if (head->nextitem != NULL) {
113  //there is something there, and its not alone
114  tail->nextitem = head;
115  tail = head;
116  head = head->nextitem;
117  tail->nextitem = NULL;
118  }
119  }
120 }
void navdrawlist::wipe ( )

Definition at line 94 of file drawlist.cpp.

References navdrawnode::nextitem.

Referenced by NavigationSystem::DrawSystem(), and ~navdrawlist().

95 {
96  navdrawnode *temp = head;
97  navdrawnode *tempdelete = NULL;
98  while (temp != NULL) {
99  tempdelete = temp;
100  temp = temp->nextitem;
101  delete tempdelete;
102  }
103  head = NULL;
104  n_contents = 0;
105 }

Member Data Documentation

float navdrawlist::unselectedalpha

Definition at line 81 of file drawlist.h.

Referenced by draw(), and navdrawlist().


The documentation for this class was generated from the following files: