コード例 #1
0
    /**
     *
     * @param Ultimatum_Model_GroupProfileIF $pParam
     * @return <type>
     */
    public function powerMatrix(Ultimatum_Model_GroupProfileIF $profile)
    {
        ob_start();
        ?>
<table class="ult_power_matrix">
    <tr>
        <th>Off</th>
        <th>Def</th>
        <th>Grow</th>
        <th>Net</th>
    </tr>
    <?php 
        if (Ultimatum_Model_Ultgames::get_active()) {
            ?>
    <tr>
        <td><small><?php 
            echo $profile->offense_size(TRUE);
            ?>
 &times; <?php 
            echo $profile->offense_efficiency(TRUE);
            ?>
</small></td>
        <td><small><?php 
            echo $profile->defense_size(TRUE);
            ?>
 &times; <?php 
            echo $profile->defense_efficiency(TRUE);
            ?>
</small></td>
        <td><small><?php 
            echo $profile->growth_size(TRUE);
            ?>
 &times; <?php 
            echo $profile->growth_efficiency(TRUE);
            ?>
</small></td>
        <td><small><?php 
            echo $profile->network_size(TRUE);
            ?>
 &times; <?php 
            echo $profile->network_efficiency(TRUE);
            ?>
</small></td>
        </tr>
    <tr>
        <td><?php 
            echo $profile->offense_effect(TRUE);
            ?>
</td>
        <td><?php 
            echo $profile->defense_effect(TRUE);
            ?>
</td>
        <td><?php 
            echo $profile->growth_effect(TRUE);
            ?>
</td>
        <td><?php 
            echo $profile->network_effect(TRUE);
            ?>
</td>
    </tr>
    <?php 
        } else {
            ?>
    <tr>
        <td><?php 
            echo $profile->offense_efficiency(TRUE);
            ?>
</td>
        <td><?php 
            echo $profile->defense_efficiency(TRUE);
            ?>
</td>
        <td><?php 
            echo $profile->growth_efficiency(TRUE);
            ?>
</td>
        <td><?php 
            echo $profile->network_efficiency(TRUE);
            ?>
</td>
    </tr>

    <?php 
        }
        ?>
</table>

<?php 
        return ob_get_clean();
    }
コード例 #2
0
 /**
  *
  * @param Ultimatum_Model_GroupProfileIF $pProfile
  * @return number | string
  */
 public function gp_effect(Ultimatum_Model_GroupProfileIF $pProfile, $pFactor, $pString = FALSE)
 {
     switch (strtolower($pFactor)) {
         case 'network':
             $size = $pProfile->network_size();
             $efficiency = $pProfile->network_efficiency();
             break;
         case 'growth':
             $size = $pProfile->growth_size();
             $efficiency = $pProfile->growth_efficiency();
             break;
         case 'offense':
             $size = $pProfile->offense_size();
             $efficiency = $pProfile->offense_efficiency();
             break;
         case 'defense':
             $size = $pProfile->defense_size();
             $efficiency = $pProfile->defense_efficiency();
             break;
     }
     return self::effect($size, $efficiency, $pString);
 }