Just a few renames.
[AHbot.git] / src / game / InstanceData.h
blobcd416653ef7fc98fe3880f1e3510819756bc4478
1 /*
2 * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef MANGOS_INSTANCE_DATA_H
20 #define MANGOS_INSTANCE_DATA_H
22 #include "Common.h"
24 class Map;
25 class Unit;
26 class Player;
27 class GameObject;
28 class Creature;
30 class MANGOS_DLL_SPEC InstanceData
32 public:
34 explicit InstanceData(Map *map) : instance(map) {}
35 virtual ~InstanceData() {}
37 Map *instance;
39 //On creation, NOT load.
40 virtual void Initialize() {}
42 //On load
43 virtual void Load(const char* /*data*/) {}
45 //When save is needed, this function generates the data
46 virtual const char* Save() { return ""; }
48 void SaveToDB();
50 //Called every map update
51 virtual void Update(uint32 /*diff*/) {}
53 //Used by the map's CanEnter function.
54 //This is to prevent players from entering during boss encounters.
55 virtual bool IsEncounterInProgress() const { return false; };
57 //Called when a player successfully enters the instance.
58 virtual void OnPlayerEnter(Player *) {}
60 //Called when a gameobject is created
61 virtual void OnObjectCreate(GameObject *) {}
63 //called on creature creation
64 virtual void OnCreatureCreate(Creature * /*creature*/, uint32 /*creature_entry*/) {}
66 //All-purpose data storage 64 bit
67 virtual uint64 GetData64(uint32 /*Data*/) { return 0; }
68 virtual void SetData64(uint32 /*Data*/, uint64 /*Value*/) { }
70 //All-purpose data storage 32 bit
71 virtual uint32 GetData(uint32 /*Type*/) { return 0; }
72 virtual void SetData(uint32 /*Type*/, uint32 /*Data*/) {}
74 #endif