<?php
/** * Example of SimpleCombat class usage. * * @version: 1.0 * @author: HossamZee. * @date: 8 May 2013. */
require_once("./SimpleCombat.class.php");
/* Define a new SimpleCombat class. */ $simpleCombat = new SimpleCombat();
/* Set the attacker troops. */ $simpleCombat->setAttackerTroops( array( SimpleCombat::UNIT_MAN_WITH_HAND => 27, SimpleCombat::UNIT_MAN_WITH_SWITCHBLADE => 13, SimpleCombat::UNIT_MAN_WITH_GUN => 2, ) );
/* Set the defender troops. */ $simpleCombat->setDefenderTroops( array( SimpleCombat::UNIT_MAN_WITH_HAND => 4, SimpleCombat::UNIT_MAN_WITH_SWITCHBLADE => 10, SimpleCombat::UNIT_MAN_WITH_GUN => 1, ) );
/* Go battle. */ $simpleCombat->battle();
/* Represent the battle. */ $simpleCombat->representBattle();
|