Update CMake to 3.2.1 in .travis.yml
[supertux.git] / src / scripting / player.hpp
index 8b36aa7..a8f63b7 100644 (file)
@@ -1,12 +1,10 @@
-//  $Id$
-//
 //  SuperTux
 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
-//  This program is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU General Public License
-//  as published by the Free Software Foundation; either version 2
-//  of the License, or (at your option) any later version.
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
 //
 //  This program is distributed in the hope that it will be useful,
 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
 //  GNU General Public License for more details.
 //
 //  You should have received a copy of the GNU General Public License
-//  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-#ifndef __SCRIPTING_PLAYER_H__
-#define __SCRIPTING_PLAYER_H__
+#ifndef HEADER_SUPERTUX_SCRIPTING_PLAYER_HPP
+#define HEADER_SUPERTUX_SCRIPTING_PLAYER_HPP
 
-namespace Scripting
-{
+#ifndef SCRIPTING_API
+#include <string>
+#endif
+
+namespace scripting {
 
 class Player
 {
@@ -41,15 +41,15 @@ public:
    */
   virtual void add_coins(int count) = 0;
   /**
-   * Make tux invicible for a short amount of time
+   * Make tux invincible for a short amount of time
    */
   virtual void make_invincible() = 0;
   /**
-   * Deactivate user input for Tux
+   * Deactivate user/scripting input for Tux
    */
   virtual void deactivate() = 0;
   /**
-   * Give control back to user
+   * Give control back to user/scripting
    */
   virtual void activate() = 0;
   /**
@@ -57,12 +57,16 @@ public:
    */
   virtual void walk(float speed) = 0;
   /**
-   * Set player visible or not visible
+   * Face Tux in the proper direction
+   */
+  virtual void set_dir(bool right) = 0;
+  /**
+   * Set player visible or invisible
    */
   virtual void set_visible(bool visible) = 0;
   /**
    * returns true if the player is currently visible (that is he was not set
-   * inivisible by the set_visible method)
+   * invisible by the set_visible method)
    */
   virtual bool get_visible() = 0;
 
@@ -84,6 +88,11 @@ public:
   virtual bool get_ghost_mode() = 0;
 
   /**
+   * start kick animation
+   */
+  virtual void kick() = 0;
+
+  /**
    * play cheer animation.
    * This might need some space and behave in an unpredictable way. Best to use this at level end.
    */
@@ -111,9 +120,25 @@ public:
    */
   virtual void do_jump(float yspeed) = 0;
 
+  /**
+   * Orders the current GameSession to start a sequence
+   */
+  virtual void trigger_sequence(std::string sequence_name) = 0;
+
+  /**
+   * Uses a scriptable controller for all user input (or restores controls)
+   */
+  virtual void use_scripting_controller(bool use_or_release) = 0;
+
+  /**
+   * Instructs the scriptable controller to press or release a button
+   */
+  virtual void do_scripting_controller(std::string control, bool pressed) = 0;
 
 };
 
 }
 
 #endif
+
+/* EOF */