📄 fsm.h.svn-base
字号:
/* Copyright (C) Steve Rabin, 2000. * All rights reserved worldwide. * * This software is provided "as is" without express or implied * warranties. You may freely copy and compile this source into * applications you distribute provided that the copyright text * below is included in the resulting source code, for example: * "Portions Copyright (C) Steve Rabin, 2000" */////////////////////////////////////////////////////////////////// Filename: fsm.h//// Author: Steve Rabin// E-mail: stevera@noa.nintendo.com// From the book "Game Programming Gems"// From the article "Designing a General Robust AI Engine"//// Brief Disclaimer:// This code is free to use for commercial use and is in the// public domain. You may distribute, copy, modify, or use as// is as long as this information is present. This code makes// no guarantees written or implied and is provided solely as// an example. Have a nice day!//// Purpose:// This file contains a few functions to make the fsm// (finite state machine) work. ////////////////////////////////////////////////////////////////#ifndef _FSM_H#define _FSM_H#include "msg.h"//定义几种状态机的类型typedef enum { FSM_NULL, FSM_Unit, FSM_Player, FSM_Game, FSM_Script, FSM_Camera} FSM_Type;//定义各种状态类型typedef enum { STATE_Global, //STATE_Global must always be the first one STATE_Run, STATE_Stand, STATE_Wander, STATE_Rest, STATE_Pursue, STATE_Attack, STATE_Dead, STATE_GameRunning, STATE_GamePause, STATE_GameExcuteScript, STATE_GameEnd, STATE_CameraFree, STATE_CameraWithPlayer, STATE_CameraAuto} FSM_States;void FSMInitialize( unsigned int unique_id, FSM_Type type );float RandomBetween( float low, float high );unsigned int RandomBetween(unsigned int low, unsigned int high);//void TranslateStateName( unsigned int unique_id, unsigned int state, char* name );#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -