# goal_base.h

Go to the documentation of this file.

    00001 /* $Id: goal_base.h 23737 2012-01-03 20:37:56Z truebrain $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
    00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
    00008  */
    00009
    00012 #ifndef GOAL_BASE_H
    00013 #define GOAL_BASE_H
    00014
    00015 #include "company_type.h"
    00016 #include "goal_type.h"
    00017 #include "core/pool_type.hpp"
    00018
    00019 typedef Pool<Goal, GoalID, 1, 256> GoalPool;
    00020 extern GoalPool _goal_pool;
    00021
    00023 struct Goal : GoalPool::PoolItem<&_goal_pool> {
    00024   CompanyByte company;
    00025   GoalTypeByte type;
    00026   GoalTypeID dst;
    00027   char *text;
    00028
    00032   inline Goal() { }
    00033
    00037   inline ~Goal() { free(this->text); }
    00038 };
    00039
    00040 #define FOR_ALL_GOALS_FROM(var, start) FOR_ALL_ITEMS_FROM(Goal, goal_index, var, start)
    00041 #define FOR_ALL_GOALS(var) FOR_ALL_GOALS_FROM(var, 0)
    00042
    00043 #endif /* GOAL_BASE_H */