当前位置: 首页>>代码示例>>PHP>>正文


PHP messages::is_reload方法代码示例

本文整理汇总了PHP中messages::is_reload方法的典型用法代码示例。如果您正苦于以下问题:PHP messages::is_reload方法的具体用法?PHP messages::is_reload怎么用?PHP messages::is_reload使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在messages的用法示例。


在下文中一共展示了messages::is_reload方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process_command

 /**
  * This method process the command given by the user and call the right action to be applied.
  * @param Array $command 
  * @param string $canvas_string 
  * @return string
  */
 public function process_command()
 {
     //Obj to handle messages
     $messages = new messages();
     if ($this->values_ok) {
         switch (strtoupper($this->command_array[0])) {
             //Create a Canvas
             case 'C':
                 if (count($this->command_array) == 3) {
                     $command = $this->command_array;
                     $this->canvas = new canvas($command[1], $command[2]);
                     $messages->set_message('general-ok-0');
                 } else {
                     $messages->set_message('general-error-0');
                     $messages->is_reload();
                 }
                 break;
                 //Print a Line
             //Print a Line
             case 'L':
                 if (!$this->canvas->get_canvas_state()) {
                     $messages->set_message('line-error-1');
                 } elseif (count($this->command_array) == 5) {
                     $command = $this->command_array;
                     $this->canvas->draw_line(array($command[1], $command[2]), array($command[3], $command[4]), $messages);
                     $messages->set_message('general-ok-0');
                 } else {
                     $messages->set_message('general-error-0');
                 }
                 break;
                 //Print a Rectangle
             //Print a Rectangle
             case 'R':
                 if (!$this->canvas->get_canvas_state()) {
                     $messages->set_message('rec-error-0');
                 } elseif (count($this->command_array) == 5) {
                     $command = $this->command_array;
                     $this->canvas->draw_rectangle(array($command[1], $command[2]), array($command[3], $command[4]));
                     $messages->set_message('general-ok-0');
                 } else {
                     $messages->set_message('general-error-0');
                 }
                 break;
                 //Bucket fill action
             //Bucket fill action
             case 'B':
                 if (!$this->canvas->get_canvas_state()) {
                     $messages->set_message('line-error-1');
                 } elseif (count($this->command_array) == 4) {
                     $command = $this->command_array;
                     $this->canvas->bucket_fill(array($command[1], $command[2]), $command[3]);
                     $messages->set_message('general-ok-0');
                 } else {
                     $messages->set_message('general-error-0');
                 }
                 break;
                 //Restart the app
             //Restart the app
             case 'Q':
                 $messages->set_message('general-ok-0');
                 $messages->is_reload();
                 break;
             default:
                 break;
         }
     } else {
         return false;
     }
     return $this->canvas->get_canvas_string($messages) . '<br/>' . $messages->get_current_message();
 }
开发者ID:jucachap,项目名称:huge-challenge,代码行数:76,代码来源:command.class.php


注:本文中的messages::is_reload方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。