以下のようなクラスの構造を作ったのですが
件名とおりクラス内のメンバに別のクラスオブジェクトのポインタ(今回はShotクラスにActionクラスオブジェクトのポインタ)
を含めたいのですが、いくつかのコンパイルエラーがでてしまい困っています。
どのような点を改良すれば以上の構造を実現できるかが知りたいです。
よろしくお願いします。
Action.h
#pragma once
#include "Shot.h"
#define A_LIST_MAX 1024
class Action{
public:
int id;
int target;//アクションがくっついてるオブジェクトのarraynumと一致
int type;//移動か弾幕かその他か
int stage;//利用するステージ
Action();
~Action();
void Process();
//Enemy_Shot *A_p;
//元Danmakuクラスの引数(後々Friendでアクセスさせる仕様に)
double startangle;
double speed;
double anglespace;
int way;
int timespace;
int endtime;
private:
};
extern Action ActionList[A_LIST_MAX];
//extern Action *action[1024];
#pragma once
#include"Action.h"
class Enemy_Shot{
public:
Enemy_Shot();
~Enemy_Shot();
Action *action;//エラーがでる箇所
int ActionID;
Enemy_Shot *s;//自分自身へのポインタ(参照用)
void Process();
void Renew();//一部の値を元となるEnemyクラスと合わせる
static int total;
static int object_n;//
double x;
double y;
int t;
int id;
int mode;//敵が死んだらShotが消えるか(0で消えない)
private:
int exi;
int actionflag;
};
extern Enemy_Shot * shot[1024];
エラー 1 error C2143: 構文エラー : ';' が '*' の前にありません。 c:\users\Myname\documents\visual studio 2013\projects\fordebug\fordebug\shot.h 8 1 ForDebug