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

       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_board.cpp File Reference

The board action. More...

#include <stdio.h>
#include <stdlib.h>
#include "stratagus.h"
#include "unittype.h"
#include "animation.h"
#include "player.h"
#include "unit.h"
#include "actions.h"
#include "interface.h"
#include "pathfinder.h"
#include "map.h"

Go to the source code of this file.

Functions

static int MoveToTransporter (CUnit *unit)
static int WaitForTransporter (CUnit *unit)
static void EnterTransporter (CUnit *unit)
void HandleActionBoard (CUnit *unit)
 Handle command unload.


Detailed Description

The board action.

Definition in file action_board.cpp.


Function Documentation

static void EnterTransporter ( CUnit unit  )  [static]

void HandleActionBoard ( CUnit unit  ) 

Handle command unload.

The unit boards a transporter.

Todo:
FIXME: While waiting for the transporter the units must defend themselves.
Parameters:
unit Pointer to unit.

Definition at line 185 of file action_board.cpp.

References CUnitType::Animations, CUnit::ClearAction(), EnterTransporter(), CMap::Info, Map, CMapInfo::MapHeight, CMapInfo::MapWidth, MoveToTransporter(), NewResetPath, NoUnitP, CUnit::Orders, PF_REACHED, PF_UNREACHABLE, CUnit::RefsDecrease(), CAnimations::Still, CUnit::SubAction, CUnit::Type, UnitShowAnimation(), CUnit::Wait, and WaitForTransporter().

static int MoveToTransporter ( CUnit unit  )  [static]

Move to transporter.

Parameters:
unit Pointer to unit, moving to transporter.
Returns:
>0 remaining path length, 0 wait for path, -1 reached goal, -2 can't reach the goal.

Definition at line 60 of file action_board.cpp.

References Assert, DoActionMove(), NewResetPath, CUnit::Orders, UnitActionBoard, CUnit::X, CUnit::Y, and y.

Referenced by HandleActionBoard().

static int WaitForTransporter ( CUnit unit  )  [static]

Wait for transporter.

Parameters:
unit Pointer to unit.
Returns:
True if ship arrived/present, False otherwise.

Definition at line 86 of file action_board.cpp.

References CanTransport(), DebugPrint, CUnit::IsVisibleAsGoal(), MapDistanceBetweenUnits(), NoUnitP, CUnit::Orders, CUnit::Player, CUnit::RefsDecrease(), CUnit::SubAction, and CUnit::Wait.

Referenced by HandleActionBoard().


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