SBSPSS/source/enemy/npcpath.h

56 lines
952 B
C
Raw Normal View History

2001-01-16 22:40:14 +01:00
/*=========================================================================
npcpath.h
Author: CRB
Created:
Project: Spongebob
Purpose:
Copyright (c) 2000 Climax Development Ltd
===========================================================================*/
2001-01-18 20:18:39 +01:00
#ifndef __ENEMY_NPCPATH_H__
#define __ENEMY_NPCPATH_H__
#include "system\global.h"
2001-01-16 22:56:29 +01:00
2001-01-16 22:40:14 +01:00
class CNpcWaypoint
{
public:
DVECTOR pos;
2001-01-18 20:18:39 +01:00
bool isPointNear( DVECTOR testPos, s32 *xDist, s32 *yDist );
2001-01-16 22:40:14 +01:00
};
enum NPC_PATH_TYPE
{
SINGLE_USE_PATH = 0,
REPEATING_PATH = 1,
PONG_PATH = 2,
};
class CNpcPath
{
enum
{
NPC_MAX_WAYPOINTS = 4,
};
private:
CNpcWaypoint waypoint[NPC_MAX_WAYPOINTS];
NPC_PATH_TYPE pathType;
u8 currentWaypoint;
u8 waypointCount;
2001-01-16 22:56:29 +01:00
bool reversePath;
2001-01-16 22:40:14 +01:00
public:
2001-01-16 22:56:29 +01:00
void initPath();
2001-01-16 22:40:14 +01:00
void addWaypoint( DVECTOR newPos );
void setPathType( NPC_PATH_TYPE newPathType );
bool incPath();
2001-01-18 20:18:39 +01:00
s32 think( DVECTOR currentPos, bool *pathComplete );
2001-01-16 22:56:29 +01:00
};
#endif