Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

stubs.cpp File Reference

#include <stdlib.h>
#include <stdio.h>
#include "../src/obstacle.h"
#include "../src/bolt.h"
#include "../src/spectre.h"
#include <algorithm>
#include <math.h>

Include dependency graph for stubs.cpp:

Include dependency graph

Defines

#define assert(a)

Typedefs

typedef std::pair< int, int > IdPair
typedef std::pair< bool, IdPairCollVecPair
typedef std::vector< CollVecPairCollVecType

Functions

template<class Number> Number minimum (Number a, Number b)
template<class Number> Number maximum (Number a, Number b)
void MyCollide (int id1, int id2)

Variables

CollVecType collVec
int totalbadcoll

Define Documentation

#define assert  
 


Typedef Documentation

typedef std::pair<bool, IdPair> CollVecPair
 

typedef std::vector<CollVecPair> CollVecType
 

typedef std::pair<int, int> IdPair
 


Function Documentation

template<class Number>
Number maximum Number    a,
Number    b
[inline]
 

00057                                            {
00058     return a>b?a:b;
00059 }

template<class Number>
Number minimum Number    a,
Number    b
[inline]
 

00053                                            {
00054     return a<b?a:b;
00055 }

void MyCollide int    id1,
int    id2
 

00073                                   {
00074 //  printf("%s Collided with %s\n", name.c_str(), oth->name.c_str());
00075     CollVecType::iterator iter = std::find(collVec.begin(),collVec.end(),CollVecPair(false, IdPair(id1,id2)));
00076     if (iter==collVec.end()) {
00077         iter=std::find(collVec.begin(),collVec.end(),CollVecPair(true, IdPair(id1,id2)));
00078         if (iter!=collVec.end()) {
00079 //          printf("%d and %d collided twice\n", id1, id2);
00080         } else {
00081             printf("%d colliding with %d\n", id1, id2);
00082             ++totalbadcoll;
00083         }
00084     } else {
00085         (*iter).first=true;
00086     }
00087 }


Variable Documentation

CollVecType collVec
 

int totalbadcoll
 


Generated on Mon Jul 7 21:13:50 2003 for Ethereal by doxygen1.2.15