Advertisement
nio_kasgami

Game_AI Beta

May 16th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*:
  2.  * Game_AI TypeScript Format
  3. */
  4.  
  5.  
  6. declare var $dataAI;
  7.  
  8.  
  9. namespace Emoji{
  10.  
  11.   /**
  12.    * The superClass of all AI it's process the AI interactions.
  13.    * @class Game_AI
  14.    * @constructor
  15.    * @param {string} interactions the method who call interactions.
  16.    * @access new Emoji.Game_AI(id);
  17.    */
  18.   export class Game_AI {
  19.  
  20.       private _id: number; // private variable declaration.
  21.       private _personality: any; // private variable declaration.
  22.  
  23.     /**
  24.      * Will init the AI and private method for get the datas.
  25.      * @param {number} id The ID of the AI.
  26.      */
  27.     constructor(id : number){
  28.       this._id = id;
  29.       this._personality = $dataAI[this._id];
  30.       this.initMembers();
  31.       this.setMessageSystem();
  32.       this.getData();
  33.       this.createContents();
  34.     }
  35.  
  36.     /**
  37.      * Init the core variable of the system.
  38.      * @private
  39.      */
  40.     private initMembers(){
  41.  
  42.     }
  43.  
  44.     /**
  45.      * Set the Message System used for the AI
  46.      * @private
  47.      */
  48.     private setMessageSystem(){}
  49.  
  50.     /**
  51.      * Get the data from the JSON
  52.      * @private
  53.      */
  54.     private getData(){}
  55.  
  56.     /**
  57.      * Create the sprite contents of the AI.
  58.      * @private
  59.      */
  60.     private createContents(){}
  61.  
  62.     /**
  63.      * Start the AI Interactions. It's meant to be call on the start of the Scene.
  64.      * @public
  65.      */
  66.     public start(){}
  67.  
  68.     /**
  69.      * Update the AI. It's meant to be call in the update method of the scene.
  70.      * @public
  71.      */
  72.     public update(){}
  73.  
  74.     /**
  75.      * Terminate the AI. It's meant to be call in the terminate method of the scene.
  76.      * @public
  77.      */
  78.     public terminate(){}
  79.  
  80.     /**
  81.      * [interaction description]
  82.      * @param {string} interactionType [description]
  83.      */
  84.     public interaction(interactionType : string){}
  85.  
  86.     private startInteraction(interactionType : string){}
  87.   }
  88.  
  89.   class Sprite_AI extends Sprite {
  90.    
  91.       private _data: number;
  92.  
  93.     /**
  94.      * [constructor description]
  95.      * @param {number} id [description]
  96.      */
  97.     constructor(id : number) {
  98.         super();
  99.         this._data = id;
  100.         this.initMembers();
  101.     }
  102.  
  103.     private initMembers(){}
  104.   }
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement