Beispiel #1
0
void char_selection::genElements()
{
    int i;
    int x, y;

    for (i = 0; i < archetypes.size(); i++)
    {
        x = 10 + (i * 128);
        y = 10;
        includeElement( new player_select_sprite( x, y, 64, 64, archetypes[i]->texture, archetypes[i]->name, ( i + 1 ) * selection_mask) ); //use "i" return value to look up data.
    }
}
Beispiel #2
0
int main (int argc, char** argv) {
  tree_t t = tree_new();
  list_t l = list_new();
  
  for (int i=0; i<argc-1; i++)
    list_add_element (l, argv[i+1]);
  
  int j=0;
  for (element_t e = list_get_first_element (l); e != NULL; e = element_get_next (e)) {
    if (includeElement())
      tree_insert_node (t, e);
  }
  printf ("Before deleting list:\n");
  tree_ordered_suffix_print (t);
  list_delete (l);
  printf ("After deleting list:\n");
  tree_ordered_suffix_print (t);
  tree_delete (t);
}