Skip to content

Commit

Permalink
Change the method names to make more sense
Browse files Browse the repository at this point in the history
  • Loading branch information
thekabal committed Feb 12, 2017
1 parent 85f5ecd commit f4e02a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions classes/Kabal.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

class Kabal
{
public static function kabalTrade(\PDO $pdo_db, array $playerinfo, Reg $tkireg): void
public static function trade(\PDO $pdo_db, array $playerinfo, Reg $tkireg): void
{
// FUTURE: We need to get rid of this.. the bug causing it needs to be identified and squashed. In the meantime, we want functional kabal. :)
// FUTURE: We need to get rid of this.. the bug causing it needs to be identified and squashed. In the meantime, we want working kabal. :)
$tkireg->ore_price = 11;
$tkireg->organics_price = 5;
$tkireg->goods_price = 15;
Expand Down Expand Up @@ -286,7 +286,7 @@ public static function kabalTrade(\PDO $pdo_db, array $playerinfo, Reg $tkireg):
}
}

public static function kabalMove(\PDO $pdo_db, $db, array $playerinfo, int $targetlink, array $langvars, Reg $tkireg): void
public static function move(\PDO $pdo_db, $db, array $playerinfo, int $targetlink, array $langvars, Reg $tkireg): void
{
// Obtain a target link
if ($targetlink == $playerinfo['sector'])
Expand Down Expand Up @@ -422,7 +422,7 @@ public static function kabalMove(\PDO $pdo_db, $db, array $playerinfo, int $targ
}
}

public static function kabalHunter(\PDO $pdo_db, $db, array $playerinfo, $kabalisdead, array $langvars, Reg $tkireg): void
public static function goHunt(\PDO $pdo_db, $db, array $playerinfo, $kabalisdead, array $langvars, Reg $tkireg): void
{
$targetinfo = array();
$rescount = $db->Execute("SELECT COUNT(*) AS num_players FROM {$db->prefix}ships WHERE ship_destroyed='N' AND email NOT LIKE '%@kabal' AND ship_id > 1");
Expand Down Expand Up @@ -551,7 +551,7 @@ public static function kabalHunter(\PDO $pdo_db, $db, array $playerinfo, $kabali
}
}

public static function kabalRegen(\PDO $pdo_db, array $playerinfo, $kabal_unemployment, Reg $tkireg): void
public static function regen(\PDO $pdo_db, array $playerinfo, $kabal_unemployment, Reg $tkireg): void
{
$gena = null;
$gene = null;
Expand Down
12 changes: 6 additions & 6 deletions scheduler/sched_kabal.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
$kabalisdead = 0;
$playerinfo = $res->fields;
// Regenerate / Buy stats
Tki\Kabal::kabalRegen($pdo_db, $playerinfo, $kabal_unemployment, $tkireg);
Tki\Kabal::regen($pdo_db, $playerinfo, $kabal_unemployment, $tkireg);
// Run through orders
$furcount++;
Expand Down Expand Up @@ -100,7 +100,7 @@
$furcount1++;
// Roam to a new sector before doing anything else
$targetlink = $playerinfo['sector'];
Tki\Kabal::kabalMove($pdo_db, $db, $playerinfo, $targetlink, $langvars, $tkireg);
Tki\Kabal::move($pdo_db, $db, $playerinfo, $targetlink, $langvars, $tkireg);
if ($kabalisdead > 0)
{
$res->MoveNext();
Expand Down Expand Up @@ -158,15 +158,15 @@
$furcount2++;
// ROAM TO A NEW SECTOR BEFORE DOING ANYTHING ELSE
$targetlink = $playerinfo['sector'];
Tki\Kabal::kabalMove($pdo_db, $db, $playerinfo, $targetlink, $langvars, $tkireg);
Tki\Kabal::move($pdo_db, $db, $playerinfo, $targetlink, $langvars, $tkireg);
if ($kabalisdead > 0)
{
$res->MoveNext();
continue;
}
// NOW TRADE BEFORE WE DO ANY AGGRESSION CHECKS
Tki\Kabal::kabalTrade($pdo_db, $playerinfo, $tkireg);
Tki\Kabal::trade($pdo_db, $playerinfo, $tkireg);
// FIND A TARGET
// IN MY SECTOR, NOT MYSELF
$reso2 = $db->Execute("SELECT * FROM {$db->prefix}ships WHERE sector = ? and email! = ? and ship_id > 1", array($targetlink, $playerinfo['email']));
Expand Down Expand Up @@ -225,7 +225,7 @@
if ($hunt == 0)
{
$furcount3h++;
Tki\Kabal::kabalHunter($pdo_db, $db, $playerinfo, $kabalisdead, $langvars, $tkireg);
Tki\Kabal::goHunt($pdo_db, $db, $playerinfo, $kabalisdead, $langvars, $tkireg);
if ($kabalisdead > 0)
{
$res->MoveNext();
Expand All @@ -235,7 +235,7 @@
else
{
// ROAM TO A NEW SECTOR BEFORE DOING ANYTHING ELSE
Tki\Kabal::kabalMove($pdo_db, $db, $playerinfo, $targetlink, $langvars, $tkireg);
Tki\Kabal::move($pdo_db, $db, $playerinfo, $targetlink, $langvars, $tkireg);
if ($kabalisdead > 0)
{
$res->MoveNext();
Expand Down

0 comments on commit f4e02a4

Please sign in to comment.