____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       A futuristic real-time strategy game.
          This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project. Distributed under the "GNU General Public License"

action_train.cpp File Reference

The building train action. More...

#include <stdio.h>
#include <stdlib.h>
#include "stratagus.h"
#include "video.h"
#include "sound.h"
#include "unitsound.h"
#include "unittype.h"
#include "animation.h"
#include "player.h"
#include "unit.h"
#include "actions.h"
#include "ai.h"
#include "interface.h"
#include "ui.h"

Go to the source code of this file.

Functions

static int GetProductionCost (CUnitType *type)
static int CanHandleOrder (CUnit *unit, COrder *order)
void HandleActionTrain (CUnit *unit)
 Handle command spellcast.


Detailed Description

The building train action.

Definition in file action_train.cpp.


Function Documentation

static int CanHandleOrder ( CUnit unit,
COrder order 
) [static]

Unit can handle order.

Parameters:
unit Newly trained unit.
order New order for the unit.
Returns:
1 if the the unit can do it, 0 otherwise.

Definition at line 74 of file action_train.cpp.

References COrder::Action, CUnitType::CanAttack, CUnitType::Harvester, CUnit::Type, UnitActionAttack, UnitActionBoard, UnitActionResource, CUnitType::UnitType, and UnitTypeLand.

Referenced by HandleActionTrain().

static int GetProductionCost ( CUnitType type  )  [static]

Get the production cost of a unit type Use the energy cost if it's not 0, otherwise use magma cost

Definition at line 60 of file action_train.cpp.

References EnergyCost, MagmaCost, and CUnitType::ProductionCosts.

void HandleActionTrain ( CUnit unit  ) 


Generated on Sat Feb 21 00:28:15 2009 for Bos Wars by  doxygen 1.5.6