$treeview $search $mathjax
Stratagus  2.2.6
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
           Stratagus - A free fantasy real time strategy game engine

src/action/action_patrol.cpp File Reference

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

Functions

action_patrol.cpp - The patrol action.
bool AutoRepair (CUnit &unit)
bool AutoCast (CUnit &unit)
static void SwapPatrolPoints (CUnit &unit)
void HandleActionPatrol (CUnit &unit)
 Handle command patrol.

Function Documentation

bool AutoCast ( CUnit unit  ) 

Auto cast a spell if possible

Returns:
true if a spell was auto cast, false otherwise

bool AutoRepair ( CUnit unit  ) 

Auto repair a unit if possible

Returns:
true if the unit is repairing, false otherwise

void HandleActionPatrol ( CUnit unit  ) 

Handle command patrol.

Unit Patrol: The unit patrols between two points. Any enemy unit in reaction range is attacked.

Todo:
FIXME: Should do some tries to reach the end-points. Should support patrol between more points! Patrol between units.
Parameters:
unit Patroling unit pointer.

static void SwapPatrolPoints ( CUnit unit  )  [static]

Swap the patrol points.

(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.