本文整理汇总了PHP中Success::commandDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP Success::commandDelete方法的具体用法?PHP Success::commandDelete怎么用?PHP Success::commandDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Success
的用法示例。
在下文中一共展示了Success::commandDelete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: commandMain
function commandMain($hako, $data)
{
global $init;
$id = $data['ISLANDID'];
$num = $hako->idToNumber[$id];
$island = $hako->islands[$num];
$name = $island['name'];
// パスワード
if (!Util::checkPassword($island['password'], $data['PASSWORD'])) {
// password間違い
HakoError::wrongPassword();
return;
}
// モードで分岐
$command = $island['command'];
if (strcmp($data['COMMANDMODE'], 'delete') == 0) {
Util::slideFront($command, $data['NUMBER']);
Success::commandDelete();
} else {
if ($data['COMMAND'] == $init->comAutoPrepare || $data['COMMAND'] == $init->comAutoPrepare2) {
// フル整地、フル地ならし
// 座標配列を作る
$r = Util::makeRandomPointArray();
$rpx = $r[0];
$rpy = $r[1];
$land = $island['land'];
// コマンドの種類決定
switch ($data['COMMAND']) {
case $init->comAutoPrepare:
$kind = $init->comPrepare;
break;
case $init->comAutoPrepare2:
$kind = $init->comPrepare2;
break;
}
// $kind = $init->comPrepare;
// if($data['COMMAND'] == $init->comAutoPrepare2) {
// $kind = $init->comPrepare2;
// }
$i = $data['NUMBER'];
$j = 0;
while ($j < $init->pointNumber && $i < $init->commandMax) {
$x = $rpx[$j];
$y = $rpy[$j];
if ($land[$x][$y] == $init->landWaste) {
Util::slideBack($command, $i);
$command[$i] = array('kind' => $kind, 'target' => 0, 'x' => $x, 'y' => $y, 'arg' => 0);
$i++;
}
$j++;
}
Success::commandAdd();
} else {
if ($data['COMMAND'] == $init->comAutoReclaim) {
$r = Util::makeRandomPointArray();
$rpx = $r[0];
$rpy = $r[1];
$land = $island['land'];
$landValue = $island['landValue'];
$i = $data['NUMBER'];
$j = 0;
while ($j < $init->pointNumber && $i < $init->commandMax) {
$x = $rpx[$j];
$y = $rpy[$j];
$kind = $land[$x][$y];
$lv = $landValue[$x][$y];
if ($kind == $init->landSea && $lv == 1) {
Util::slideBack($command, $i);
$command[$i] = array('kind' => $init->comReclaim, 'target' => 0, 'x' => $x, 'y' => $y, 'arg' => 0);
$i++;
}
$j++;
}
/*
} elsif($HcommandKind == $HcomAutoDestroy) {
# 浅瀬掘削
makeRandomPointArray();
my($land) = $island->{'land'};
my($landValue) = $island->{'landValue'};
my($x, $y, $kind, $lv, $i, $n);
$n = 0;
for ($i = 0; ($i < $HpointNumber) && ($n < $HcommandMax); $i++) {
$x = $Hrpx[$i];
$y = $Hrpy[$i];
$kind = $land->[$x][$y];
$lv = $landValue->[$x][$y];
if (($kind == $HlandSea) && ($lv == 1)) {
# 浅瀬
slideBack($command, $HcommandPlanNumber);
$command->[$HcommandPlanNumber] = {
'kind' => $HcomDestroy, # 掘削
'target' => 0,
'x' => $x,
'y' => $y,
'arg' => 0
};
$n++;
}
//.........这里部分代码省略.........