<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ko">
	<id>https://ko.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Een</id>
	<title>Board Game Arena - 사용자 기여 [ko]</title>
	<link rel="self" type="application/atom+xml" href="https://ko.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Een"/>
	<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/%ED%8A%B9%EC%88%98:%EA%B8%B0%EC%97%AC/Een"/>
	<updated>2026-09-24T09:40:06Z</updated>
	<subtitle>사용자 기여</subtitle>
	<generator>MediaWiki 1.39.0</generator>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Gamehelppuertorico&amp;diff=1085</id>
		<title>Gamehelppuertorico</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Gamehelppuertorico&amp;diff=1085"/>
		<updated>2014-03-02T10:27:41Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Two players variant */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
Be the player with the most victory points at the end of the game by collecting:&lt;br /&gt;
&lt;br /&gt;
* victory points earned for buildings&lt;br /&gt;
* victory point tokens earned at the captain phase&lt;br /&gt;
* conditional victory points earned at the end of the game for occupied large buildings&lt;br /&gt;
&lt;br /&gt;
In case of a tie, the player owning the most doubloons and goods is the winner.&lt;br /&gt;
&lt;br /&gt;
== Rules summary ==&lt;br /&gt;
&lt;br /&gt;
The game is played over several rounds.&lt;br /&gt;
At the start of a round, the governor selects a role, then each player in turn selects a role.&lt;br /&gt;
At the end of the round, the governor token moves to the next player.&lt;br /&gt;
&lt;br /&gt;
When a role has been chosen, each player in turn plays the action for this role. Only the player who selected the role can use the role privilege.&lt;br /&gt;
&lt;br /&gt;
Available roles are the following:&lt;br /&gt;
&lt;br /&gt;
* Mayor: colonists set foot in the new world ! Privilege : the mayor can get one more colonist from the supply. Action : in turn, begining with the mayor, players get one colonist from the ship, until it is empty. Then players have to set colonists on their buildings and plantations.&lt;br /&gt;
* Craftsman: goods are produced. Privilege : the craftsman can produce one more good of his choice. Action : produce goods for your occupied buildings and plantations.&lt;br /&gt;
* Trader: goods are sold to the trading house. Privilege : the trader earns 1 extra doubloon if he sells. Action : sell one good the trading house doesn&#039;t have yet.&lt;br /&gt;
* Settler : plantations settlement. Privilege : the settler can get a quarry instead of a plantation. Action : get a plantation chosen among those available.&lt;br /&gt;
* Builder : buildings are bought and built. Privilege : the builder can get a building for 1 doubloon less than the regular price. Action : get a building chosen among those available.&lt;br /&gt;
* Captain : victory points are won by shipping goods to the old world. Privilege : the captain earns one extra victory points if he ships some goods. Action : select a type of good to load on a cargo ship; 1 victory point is earned for each barrel of this type of good loaded on the ship.&lt;br /&gt;
* Prospector : gold rush brings money ! Privilege : the prospector gets one doubloon from the bank. Action : none.&lt;br /&gt;
&lt;br /&gt;
Please also note that occupied violet buildings have modifier effects for role actions.&lt;br /&gt;
&lt;br /&gt;
End of game happens at the end of the round for which one of the following events comes to pass :&lt;br /&gt;
&lt;br /&gt;
* there is not enough colonists in the supply to refill the colonist ship at the end of the mayor phase&lt;br /&gt;
* the last victory point token has been earned during the captain phase&lt;br /&gt;
* at least one of the players built on his 12th and last free space in the city.&lt;br /&gt;
&lt;br /&gt;
== Playing online ==&lt;br /&gt;
&lt;br /&gt;
Choosing a role : click on the role of your choice in the list on the right of your game board.&lt;br /&gt;
&lt;br /&gt;
* Mayor role : accept or refuse to get an extra colonist from the supply. Colonists are then automatically recruited by players. Click on a building or a plantation to setup a colonist on it. Click on a colonist to send it back to San Juan (the counter for colonists in San Juan is situated in your player panel on the right of the page).&lt;br /&gt;
&lt;br /&gt;
* Craftsman role : goods production is automated (counters for goods owned are in the player panel on the right of the page). Then, choose one extra good that you can produce as your privilege.&lt;br /&gt;
&lt;br /&gt;
* Trader role : choose a good that you want to sell by clicking on the appropriate counter in your player panel.&lt;br /&gt;
&lt;br /&gt;
* Settler role : click on the plantation (or quarry) that you want. Placement on your board is automated.&lt;br /&gt;
&lt;br /&gt;
* Builder role : click on the building that you want to buy. Placement on your board is automated.&lt;br /&gt;
&lt;br /&gt;
* Captain role : click on the cargo boat on which you want to ship some goods. Then choose the type of good that you want to ship by clicking on the appropriate counter in your player panel. At the end of the captain phase, if you have some goods to store (warehouse or windrose), click on the corresponding counter. Stored goods will be highlighted by a red frame.&lt;br /&gt;
&lt;br /&gt;
* Prospector role : doubloon is earned immediately.&lt;br /&gt;
&lt;br /&gt;
Tooltips are available to give information on roles and buildings by hovering over game elements with the mouse.&lt;br /&gt;
&lt;br /&gt;
== &#039;Balanced game&#039; variant ==&lt;br /&gt;
&lt;br /&gt;
This variant implements two game balance fixes giving each player an equal chance of winning as listed in the [http://en.wikipedia.org/wiki/Puerto_Rico_%28board_game%29 Puerto Rico (board game) Wikipedia page].&lt;br /&gt;
&lt;br /&gt;
* The prices of the Factory and University buildings are swapped so that the Factory costs 8 doubloons and the University costs 7 doubloons&lt;br /&gt;
* Any player that starts with a corn plantation starts with 1 doubloon less than the players that start with an indigo plantation.&lt;br /&gt;
&lt;br /&gt;
== Two players variant ==&lt;br /&gt;
&lt;br /&gt;
Craftsman Angst : if this variant is selected, players alternate selecting a role as usual, until the Governor has selected &#039;&#039;&#039;three&#039;&#039;&#039; roles and the opponent has selected &#039;&#039;&#039;two&#039;&#039;&#039; roles (instead of three in a classic two players game), then the governor token goes to the opponent and a new round starts.&lt;br /&gt;
This variant avoids the consecutive selection of two roles by the same player which happens on a change of round with the classic two player game rules.&lt;br /&gt;
&lt;br /&gt;
This variant is described on [http://www.boardgamegeek.com/thread/679955/the-craftsman-angst-variant-the-most-popular-revis Board Game Geek].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Have a good game !&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Gamehelppuertorico&amp;diff=1084</id>
		<title>Gamehelppuertorico</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Gamehelppuertorico&amp;diff=1084"/>
		<updated>2014-03-02T10:26:22Z</updated>

		<summary type="html">&lt;p&gt;Een: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
Be the player with the most victory points at the end of the game by collecting:&lt;br /&gt;
&lt;br /&gt;
* victory points earned for buildings&lt;br /&gt;
* victory point tokens earned at the captain phase&lt;br /&gt;
* conditional victory points earned at the end of the game for occupied large buildings&lt;br /&gt;
&lt;br /&gt;
In case of a tie, the player owning the most doubloons and goods is the winner.&lt;br /&gt;
&lt;br /&gt;
== Rules summary ==&lt;br /&gt;
&lt;br /&gt;
The game is played over several rounds.&lt;br /&gt;
At the start of a round, the governor selects a role, then each player in turn selects a role.&lt;br /&gt;
At the end of the round, the governor token moves to the next player.&lt;br /&gt;
&lt;br /&gt;
When a role has been chosen, each player in turn plays the action for this role. Only the player who selected the role can use the role privilege.&lt;br /&gt;
&lt;br /&gt;
Available roles are the following:&lt;br /&gt;
&lt;br /&gt;
* Mayor: colonists set foot in the new world ! Privilege : the mayor can get one more colonist from the supply. Action : in turn, begining with the mayor, players get one colonist from the ship, until it is empty. Then players have to set colonists on their buildings and plantations.&lt;br /&gt;
* Craftsman: goods are produced. Privilege : the craftsman can produce one more good of his choice. Action : produce goods for your occupied buildings and plantations.&lt;br /&gt;
* Trader: goods are sold to the trading house. Privilege : the trader earns 1 extra doubloon if he sells. Action : sell one good the trading house doesn&#039;t have yet.&lt;br /&gt;
* Settler : plantations settlement. Privilege : the settler can get a quarry instead of a plantation. Action : get a plantation chosen among those available.&lt;br /&gt;
* Builder : buildings are bought and built. Privilege : the builder can get a building for 1 doubloon less than the regular price. Action : get a building chosen among those available.&lt;br /&gt;
* Captain : victory points are won by shipping goods to the old world. Privilege : the captain earns one extra victory points if he ships some goods. Action : select a type of good to load on a cargo ship; 1 victory point is earned for each barrel of this type of good loaded on the ship.&lt;br /&gt;
* Prospector : gold rush brings money ! Privilege : the prospector gets one doubloon from the bank. Action : none.&lt;br /&gt;
&lt;br /&gt;
Please also note that occupied violet buildings have modifier effects for role actions.&lt;br /&gt;
&lt;br /&gt;
End of game happens at the end of the round for which one of the following events comes to pass :&lt;br /&gt;
&lt;br /&gt;
* there is not enough colonists in the supply to refill the colonist ship at the end of the mayor phase&lt;br /&gt;
* the last victory point token has been earned during the captain phase&lt;br /&gt;
* at least one of the players built on his 12th and last free space in the city.&lt;br /&gt;
&lt;br /&gt;
== Playing online ==&lt;br /&gt;
&lt;br /&gt;
Choosing a role : click on the role of your choice in the list on the right of your game board.&lt;br /&gt;
&lt;br /&gt;
* Mayor role : accept or refuse to get an extra colonist from the supply. Colonists are then automatically recruited by players. Click on a building or a plantation to setup a colonist on it. Click on a colonist to send it back to San Juan (the counter for colonists in San Juan is situated in your player panel on the right of the page).&lt;br /&gt;
&lt;br /&gt;
* Craftsman role : goods production is automated (counters for goods owned are in the player panel on the right of the page). Then, choose one extra good that you can produce as your privilege.&lt;br /&gt;
&lt;br /&gt;
* Trader role : choose a good that you want to sell by clicking on the appropriate counter in your player panel.&lt;br /&gt;
&lt;br /&gt;
* Settler role : click on the plantation (or quarry) that you want. Placement on your board is automated.&lt;br /&gt;
&lt;br /&gt;
* Builder role : click on the building that you want to buy. Placement on your board is automated.&lt;br /&gt;
&lt;br /&gt;
* Captain role : click on the cargo boat on which you want to ship some goods. Then choose the type of good that you want to ship by clicking on the appropriate counter in your player panel. At the end of the captain phase, if you have some goods to store (warehouse or windrose), click on the corresponding counter. Stored goods will be highlighted by a red frame.&lt;br /&gt;
&lt;br /&gt;
* Prospector role : doubloon is earned immediately.&lt;br /&gt;
&lt;br /&gt;
Tooltips are available to give information on roles and buildings by hovering over game elements with the mouse.&lt;br /&gt;
&lt;br /&gt;
== &#039;Balanced game&#039; variant ==&lt;br /&gt;
&lt;br /&gt;
This variant implements two game balance fixes giving each player an equal chance of winning as listed in the [http://en.wikipedia.org/wiki/Puerto_Rico_%28board_game%29 Puerto Rico (board game) Wikipedia page].&lt;br /&gt;
&lt;br /&gt;
* The prices of the Factory and University buildings are swapped so that the Factory costs 8 doubloons and the University costs 7 doubloons&lt;br /&gt;
* Any player that starts with a corn plantation starts with 1 doubloon less than the players that start with an indigo plantation.&lt;br /&gt;
&lt;br /&gt;
== Two players variant ==&lt;br /&gt;
&lt;br /&gt;
Craftsman Angst : if this variant is selected, players alternate selecting a role as usual, until the Governor has selected three roles and the opponent has selected two (instead of three in a classic two players game), then the governor token goes to the opponent and a new round starts.&lt;br /&gt;
So it avoids the consecutive selection of two roles by the same player that happens on a change of round with the classic two player game.&lt;br /&gt;
&lt;br /&gt;
This variant is described on [http://www.boardgamegeek.com/thread/679955/the-craftsman-angst-variant-the-most-popular-revis Board Game Geek].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Have a good game !&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Stock&amp;diff=1082</id>
		<title>Stock</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Stock&amp;diff=1082"/>
		<updated>2014-02-24T18:33:09Z</updated>

		<summary type="html">&lt;p&gt;Een: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;quot;Stock&amp;quot; is a javascript component that you can use on your game interface to display a set of elements of the same size that need to be arranged in one or several lines.&lt;br /&gt;
&lt;br /&gt;
Stock is very flexible and is the most used component in BGA games.&lt;br /&gt;
&lt;br /&gt;
Stock is used for example:&lt;br /&gt;
* To display set of cards, typically hands (ex: in Hearts, Seasons, The Boss, Race for the Galaxy, ...).&lt;br /&gt;
* To display items in player panels (ex: Takenoko, Amyitis, ...)&lt;br /&gt;
* ... in many other situations. For example, black dice and cubes on cards in Troyes are displayed with stock components.&lt;br /&gt;
&lt;br /&gt;
Using stock:&lt;br /&gt;
* Your items are arranged nicely and sorted by type.&lt;br /&gt;
* When adding (or removing) items to the set. All items slide smoothly to their new position in the set to host the new one.&lt;br /&gt;
* Select/unselect items is a built-in functionnality.&lt;br /&gt;
* You don&#039;t have to care about inserting/removing HTML piece of code: the entire life of the stock is managed by the component.&lt;br /&gt;
&lt;br /&gt;
== Using stock: a simple example ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s have a look on how the stock is used in game &amp;quot;Hearts&amp;quot; to display a hand of standard cards.&lt;br /&gt;
&lt;br /&gt;
At first, don&#039;t forget to add &amp;quot;ebg/stock&amp;quot; as a dependency:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/stock&amp;quot;     /// &amp;lt;==== HERE&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The stock is initialized in Javascript &amp;quot;setup&amp;quot; method like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Player hand&lt;br /&gt;
    this.playerHand = new ebg.stock();&lt;br /&gt;
    this.playerHand.create( this, $(&#039;myhand&#039;), this.cardwidth, this.cardheight );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanations:&lt;br /&gt;
* We create a new stock object for the player hand.&lt;br /&gt;
* As parameters of the &amp;quot;create&amp;quot; method, we provide the width/height of an item (=a card), and the container div &amp;quot;myhand&amp;quot; - which is a simple void &amp;quot;div&amp;quot; element defines in our HTML template (.tpl).&lt;br /&gt;
&lt;br /&gt;
Then, we must tell the stock what are the items it is going to display during its life: the 52 cards of a standard card game. Of course, we did not create 52 different images, but create a &amp;quot;CSS sprite&amp;quot; image named &amp;quot;cards.jpg&amp;quot; with all the cards arranged in 4 rows and 13 columns.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how we tell stock what are the items type to display:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Explain there are 13 images per row in the CSS sprite image&lt;br /&gt;
    this.playerHand.image_items_per_row = 13;&lt;br /&gt;
&lt;br /&gt;
    // Create cards types:&lt;br /&gt;
    for( var color=1;color&amp;lt;=4;color++ )&lt;br /&gt;
    {&lt;br /&gt;
        for( var value=2;value&amp;lt;=14;value++ )&lt;br /&gt;
        {&lt;br /&gt;
            // Build card type id&lt;br /&gt;
            var card_type_id = this.getCardUniqueId( color, value );&lt;br /&gt;
            this.playerHand.addItemType( card_type_id, card_type_id, g_gamethemeurl+&#039;img/cards.jpg&#039;, card_type_id );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanations:&lt;br /&gt;
* At first, we tell the stock component that our CSS sprite contains 13 items per row. This way, it can find the correct image for each card type id.&lt;br /&gt;
* Then for the 4x13 cards, we call &amp;quot;addItemType&amp;quot; method that create the type. The arguments are the type id, the weight of the card (for sorting purpose), the URL of our CSS sprite, and the position of our card image in the CSS sprite.&lt;br /&gt;
&lt;br /&gt;
Note: in this specific example we need to generate a unique ID for each type of card based on its color and value. This is the only purpose of &amp;quot;getCardUniqueId&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
From now, if we need to add - for example - the 5 of Heart to player&#039;s hand, we can do this.&lt;br /&gt;
this.playerHand.addToStock( this.getCardUniqueId( 2 /* 2=hearts */, 5 ) );&lt;br /&gt;
&lt;br /&gt;
In reality, cards have some IDs, which are useful to manipulate them. This is the reason we are using &amp;quot;addToStockWithId&amp;quot; instead:&lt;br /&gt;
this.playerHand.addToStock( this.getCardUniqueId( 2 /* 2=hearts */, 5 ), my_card_id );&lt;br /&gt;
&lt;br /&gt;
If afterwards we want to remove this card from the stock:&lt;br /&gt;
this.playerHand.removeFromStockById( my_card_id );&lt;br /&gt;
&lt;br /&gt;
== Complete stock component reference ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;create( page, container_div, item_width, item_height ):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With create, you create a new stock component.&lt;br /&gt;
Parameters:&lt;br /&gt;
* page: the container page. Usually: &amp;quot;this&amp;quot;.&lt;br /&gt;
* container_div: the container &amp;quot;div&amp;quot; element (a void div element in your template, with an id).&lt;br /&gt;
* a stock item width and height, in pixels.&lt;br /&gt;
&lt;br /&gt;
(See &amp;quot;Hearts&amp;quot; example above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;count():&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return the total number of items in the stock right now.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addItemType( type, weight, image, image_position ):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Define a new type of item to the stock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is mandatory to define a new item type before adding it to the stock. Example: if you want to have a stock control that can contains cubes of 3 different colors, you must add 3 item types (one for each color).&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* type: ID of the type to add. You can choose any positive integer. All item types must have distinct IDs.&lt;br /&gt;
* weight: weight of items of this type. Weight value is used to sort items of the stock during the display. Note that you can specify the same weight for all items (in this case they are not sorted and their order might change randomly at any time).&lt;br /&gt;
* image: URL of item image. Most of the time, you will use a CSS sprite for stock item, so you have to specify CSS sprite image here.&lt;br /&gt;
&lt;br /&gt;
Be careful: you must specify the image url as this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  g_gamethemeurl+&#039;img/yourimage.png&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* image_position: if &amp;quot;image&amp;quot; specify the URL of a CSS sprite, you must specify the position of the item image in this CSS sprite. For example, if you have a CSS sprite with 3 cubes with a size of 20x20 pixels each (so your CSS image has for example a size of 20x60 or 60x20), you specify &amp;quot;0&amp;quot; for the first cube image, 1 for the second, 2 for the third.&lt;br /&gt;
Important: there are more than one line of items in your CSS sprite,  you must specify how many items per line you have in your CSS sprite like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Specify that there is 10 image items per row in images used in &amp;quot;myStockObject&amp;quot; control.&lt;br /&gt;
    this.myStockObject.image_items_per_row = 10;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addToStock( type, from )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add an item to the stock, with the specified type.&lt;br /&gt;
&lt;br /&gt;
To make your life easy, in most of the case we suggest you to use &amp;quot;addToStockWithId&amp;quot; in order to give an ID to the item added. &amp;quot;addToStock&amp;quot; is perfect when you are using a stock controls with items that are generic game material that does not need to be addressed individually (ex: a bunch of money tokens).&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* type: ID of the item type to use (as specified in &amp;quot;addItemType&amp;quot;)&lt;br /&gt;
* from: OPTIONNAL: if you specify a HTML item here, the item will appear on this item and will be slided to its position on the stock item.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  // Add a money token to the &amp;quot;player money&amp;quot; stock.&lt;br /&gt;
  // The money token will appear on &amp;quot;player_id&amp;quot; player panel and will move to its position.&lt;br /&gt;
  this.playerMoney.addToStock( MONEY_TOKEN, &#039;overall_player_board_&#039;+player_id );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Important: for a given stock control, you must use either addToStock or addToStockWithId, but NEVER BOTH OF THEM.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addToStockWithId( type, id, from )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is exactly the same method than &amp;quot;addToStock&amp;quot;, except that you associate an ID to the newly created item.&lt;br /&gt;
&lt;br /&gt;
This is especially useful:&lt;br /&gt;
* When you need to know which item(s) has been selected by the user (see &amp;quot;getSelectedItems&amp;quot;).&lt;br /&gt;
* When you need to remove a specific item from the stock with &amp;quot;removeFromStockById&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Important: for a given stock control, you must use either addToStock or addToStockWithId, but NEVER BOTH OF THEM.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;removeFromStock( type, to )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove an item of the specific type from the stock.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;to&amp;quot; is an optional parameter. If &amp;quot;to&amp;quot; contains the ID of an HTML element, the item removed from the stock is slided to this HTML element before it disappear.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;removeFromStockById( id, to )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove an item with a specific ID from the stock.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;to&amp;quot; is an optional parameter. If &amp;quot;to&amp;quot; contains the ID of an HTML element, the item removed from the stock is slided to this HTML element before it disappear.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;removeAll()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove all items from the stock.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPresentTypeList()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return an array with all the types of items present in the stock right now.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    this.myStockControl.removeAll();&lt;br /&gt;
    this.myStockControl.addToStock( 65 );&lt;br /&gt;
    this.myStockControl.addToStock( 34 );&lt;br /&gt;
    this.myStockControl.addToStock( 89 );&lt;br /&gt;
    this.myStockControl.addToStock( 65 );&lt;br /&gt;
    &lt;br /&gt;
    // The following returns: { 34:1,  65:1,  89:1  }&lt;br /&gt;
    var item_types = this.myStockControl.getPresentTypeList();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;resetItemsPosition()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you moved an item from the stock control manually (ex: after a drag&#039;n&#039;drop) and want to reset their position to their original ones, you can call this method.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;item_margin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By default, there is a margin of 5px between the items of a stock. You can change the member variable &amp;quot;item_margin&amp;quot; to change this.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     this.myStockControl.item_margin=5;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;changeItemsWeight( newWeights )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With this method you can change dynamically the weight of the item types in a stock control.&lt;br /&gt;
&lt;br /&gt;
Items are immediately re-sorted with the new weight.&lt;br /&gt;
&lt;br /&gt;
Example: with a stock control that contains classic cards, you can order them by value or by color. Using changeItemsWeight you can switch from one sort method to another when a player request this.&lt;br /&gt;
&lt;br /&gt;
newWeights is an associative array: item type id =&amp;gt; new weight.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Item type 1 gets a new weight of 10, 2 a new weight of 20, 3 a new weight of 30.&lt;br /&gt;
    this.myStockControl.changeItemsWeight( { 1: 10, 2: 20, 3: 30 } );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setSelectionMode( mode )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For each stock control, you can specify a selection mode:&lt;br /&gt;
* 0: no item can be selected by the player.&lt;br /&gt;
* 1: a maximum of one item can be selected by the player at the same time.&lt;br /&gt;
* 2: several items can be selected by the player at the same time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setSelectionAppeareance( type )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For each stock control, you can specify a selection highlighting type:&lt;br /&gt;
* &#039;border&#039;: there will be a red border around selected items (this is the default). The attribute &#039;apparenceBorderWidth&#039; can be used to manage the width of the border (in pixels).&lt;br /&gt;
* &#039;disappear&#039;: the selected item will fade out and disappear. This is useful when the selection has the effect of destroying the item.&lt;br /&gt;
* &#039;class&#039;: there will be an extra &#039;stockitem_selecte&#039; css class added to the element when it is selected (and removed when unselected). You can override this class in the css file for your game.&lt;br /&gt;
&lt;br /&gt;
By default this class definition is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.stockitem_selected {&lt;br /&gt;
	border: 2px solid red ! important;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to override it for example to change the border color add this in your &amp;lt;game&amp;gt;.css file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.stockitem_selected {&lt;br /&gt;
	border: 2px solid orange ! important;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: the &#039;class&#039; highlighting type has not yet been deployed on the studio - 24/02/2014. This warning will be removed after the next upgrade.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;isSelected( id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return true/false wether the specified item id has been selected or not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;selectItem( id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Select the specified item.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unselectItem( id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unselect the specified item.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unselectAll()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unselect all items of the stock.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;onChangeSelection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This callback method is called when the player select/unselect an item of the stock.&lt;br /&gt;
&lt;br /&gt;
You can connect this to one of your method like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    dojo.connect( this.myStockControl, &#039;onChangeSelection&#039;, this, &#039;onMyMethodToCall&#039; );&lt;br /&gt;
    &lt;br /&gt;
    (...)&lt;br /&gt;
    &lt;br /&gt;
    onMyMethodToCall: function( control_name )&lt;br /&gt;
    {&lt;br /&gt;
        // This method is called when myStockControl selected items changed&lt;br /&gt;
        var items = this.myStockControl.getSelectedItems();&lt;br /&gt;
        &lt;br /&gt;
        // (do something)&lt;br /&gt;
    },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;control_name&amp;quot; argument is the ID (the &amp;quot;DOM&amp;quot; id) of the &amp;quot;div&amp;quot; container of your stock control. Using &amp;quot;control_name&amp;quot;, you can use the same callback method for different Stock control and see which one trigger the method.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getSelectedItems()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return the list of selected items, as an array with the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[&lt;br /&gt;
   { type:1,  id:  1001 },&lt;br /&gt;
   { type:1,  id:  1002 },&lt;br /&gt;
   { type:3,  id:  1003 }&lt;br /&gt;
   ...&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getUnselectedItems()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as the previous one, but return unselected item instead of seleted ones.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getAllItems()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get all items (same format than getSelectedItems and getUnselectedItems).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setOverlap( horizontal_percent, vertical_percent )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make items on the stock control &amp;quot;overlap&amp;quot; on each other, to save space.&lt;br /&gt;
&lt;br /&gt;
By default, horizontal_overlap and vertical_overlap are 0.&lt;br /&gt;
&lt;br /&gt;
When horizontal_overlap=20, it means that a stock item must overlap on 20% of the width of the previous item. horizontal_overlap can&#039;t be over 100.&lt;br /&gt;
&lt;br /&gt;
vertical_overlap works differently: one items on two are shifted up.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Jaipur&amp;quot; game to see an example to use of this function.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;onItemCreate&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using onItemCreate, you can trigger a method each time a new item is added to the Stock, in order you can customize it.&lt;br /&gt;
&lt;br /&gt;
Complete example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // During &amp;quot;setup&amp;quot; phase, we associate our method &amp;quot;setupNewCard&amp;quot; with the creation of a new stock item:&lt;br /&gt;
    this.myStockItem.onItemCreate = dojo.hitch( this, &#039;setupNewCard&#039; ); &lt;br /&gt;
&lt;br /&gt;
     (...)&lt;br /&gt;
&lt;br /&gt;
    // And here is our &amp;quot;setupNewCard&amp;quot;:&lt;br /&gt;
    setupNewCard: function( card_div, card_type_id, card_id )&lt;br /&gt;
    {&lt;br /&gt;
       // Add a special tooltip on the card:&lt;br /&gt;
       this.addTooltip( card_div.id, _(&amp;quot;Some nice tooltip for this item&amp;quot;), &#039;&#039; );&lt;br /&gt;
&lt;br /&gt;
       // Note that &amp;quot;card_type_id&amp;quot; contains the type of the item, so you can do special actions depending on the item type&lt;br /&gt;
&lt;br /&gt;
       // Add some custom HTML content INSIDE the Stock item:&lt;br /&gt;
       dojo.place( this.format_block( &#039;jstpl_my_card_content&#039;, {&lt;br /&gt;
                                ....&lt;br /&gt;
                           } ), card_div.id );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips when adding/removing items to/from Stock components ==&lt;br /&gt;
&lt;br /&gt;
The usual way is the following:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Situation A&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
When you add a card to a stock item, and this card is &#039;&#039;&#039;not&#039;&#039;&#039; coming from another stock: use &amp;quot;addToStockWithId&amp;quot; with a &amp;quot;from&amp;quot; argument set to the element of your interface where card should come from.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Situation B&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
When you add a card to a stock item, and this card is coming from another stock:&lt;br /&gt;
* on the destination Stock, use &amp;quot;addToStockWithId&amp;quot; with a &amp;quot;from&amp;quot; equals to the HTML id of the corresponding item in the source Stock. For example, If the source stock id is &amp;quot;myHand&amp;quot;, then the HTML id of card 48 is &amp;quot;myHand_item_48&amp;quot;.&lt;br /&gt;
* then, remove the source item with &amp;quot;removeFromStockById&amp;quot;.&lt;br /&gt;
(note that it&#039;s important to do things in this order, because source item must still exists when you use it as the origin of the slide).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Situation C&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
When you move a card from a stock item to something that is not a stock item:&lt;br /&gt;
* insert the card as a classic HTML template (dojo.place / this.format_block).&lt;br /&gt;
* place it on the Stock item with &amp;quot;this.placeOnObject&amp;quot;, using Stock item HTML id (see above).&lt;br /&gt;
* slide it to its new position with &amp;quot;this.slideToObject&amp;quot;&lt;br /&gt;
* remove the card from the Stock item with &amp;quot;removeFromStockById&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Using the methods above, your cards should slide to, from and between your Stock controls smoothly&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Stock&amp;diff=1081</id>
		<title>Stock</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Stock&amp;diff=1081"/>
		<updated>2014-02-24T18:22:08Z</updated>

		<summary type="html">&lt;p&gt;Een: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;quot;Stock&amp;quot; is a javascript component that you can use on your game interface to display a set of elements of the same size that need to be arranged in one or several lines.&lt;br /&gt;
&lt;br /&gt;
Stock is very flexible and is the most used component in BGA games.&lt;br /&gt;
&lt;br /&gt;
Stock is used for example:&lt;br /&gt;
* To display set of cards, typically hands (ex: in Hearts, Seasons, The Boss, Race for the Galaxy, ...).&lt;br /&gt;
* To display items in player panels (ex: Takenoko, Amyitis, ...)&lt;br /&gt;
* ... in many other situations. For example, black dice and cubes on cards in Troyes are displayed with stock components.&lt;br /&gt;
&lt;br /&gt;
Using stock:&lt;br /&gt;
* Your items are arranged nicely and sorted by type.&lt;br /&gt;
* When adding (or removing) items to the set. All items slide smoothly to their new position in the set to host the new one.&lt;br /&gt;
* Select/unselect items is a built-in functionnality.&lt;br /&gt;
* You don&#039;t have to care about inserting/removing HTML piece of code: the entire life of the stock is managed by the component.&lt;br /&gt;
&lt;br /&gt;
== Using stock: a simple example ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s have a look on how the stock is used in game &amp;quot;Hearts&amp;quot; to display a hand of standard cards.&lt;br /&gt;
&lt;br /&gt;
At first, don&#039;t forget to add &amp;quot;ebg/stock&amp;quot; as a dependency:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/stock&amp;quot;     /// &amp;lt;==== HERE&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The stock is initialized in Javascript &amp;quot;setup&amp;quot; method like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Player hand&lt;br /&gt;
    this.playerHand = new ebg.stock();&lt;br /&gt;
    this.playerHand.create( this, $(&#039;myhand&#039;), this.cardwidth, this.cardheight );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanations:&lt;br /&gt;
* We create a new stock object for the player hand.&lt;br /&gt;
* As parameters of the &amp;quot;create&amp;quot; method, we provide the width/height of an item (=a card), and the container div &amp;quot;myhand&amp;quot; - which is a simple void &amp;quot;div&amp;quot; element defines in our HTML template (.tpl).&lt;br /&gt;
&lt;br /&gt;
Then, we must tell the stock what are the items it is going to display during its life: the 52 cards of a standard card game. Of course, we did not create 52 different images, but create a &amp;quot;CSS sprite&amp;quot; image named &amp;quot;cards.jpg&amp;quot; with all the cards arranged in 4 rows and 13 columns.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how we tell stock what are the items type to display:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Explain there are 13 images per row in the CSS sprite image&lt;br /&gt;
    this.playerHand.image_items_per_row = 13;&lt;br /&gt;
&lt;br /&gt;
    // Create cards types:&lt;br /&gt;
    for( var color=1;color&amp;lt;=4;color++ )&lt;br /&gt;
    {&lt;br /&gt;
        for( var value=2;value&amp;lt;=14;value++ )&lt;br /&gt;
        {&lt;br /&gt;
            // Build card type id&lt;br /&gt;
            var card_type_id = this.getCardUniqueId( color, value );&lt;br /&gt;
            this.playerHand.addItemType( card_type_id, card_type_id, g_gamethemeurl+&#039;img/cards.jpg&#039;, card_type_id );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanations:&lt;br /&gt;
* At first, we tell the stock component that our CSS sprite contains 13 items per row. This way, it can find the correct image for each card type id.&lt;br /&gt;
* Then for the 4x13 cards, we call &amp;quot;addItemType&amp;quot; method that create the type. The arguments are the type id, the weight of the card (for sorting purpose), the URL of our CSS sprite, and the position of our card image in the CSS sprite.&lt;br /&gt;
&lt;br /&gt;
Note: in this specific example we need to generate a unique ID for each type of card based on its color and value. This is the only purpose of &amp;quot;getCardUniqueId&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
From now, if we need to add - for example - the 5 of Heart to player&#039;s hand, we can do this.&lt;br /&gt;
this.playerHand.addToStock( this.getCardUniqueId( 2 /* 2=hearts */, 5 ) );&lt;br /&gt;
&lt;br /&gt;
In reality, cards have some IDs, which are useful to manipulate them. This is the reason we are using &amp;quot;addToStockWithId&amp;quot; instead:&lt;br /&gt;
this.playerHand.addToStock( this.getCardUniqueId( 2 /* 2=hearts */, 5 ), my_card_id );&lt;br /&gt;
&lt;br /&gt;
If afterwards we want to remove this card from the stock:&lt;br /&gt;
this.playerHand.removeFromStockById( my_card_id );&lt;br /&gt;
&lt;br /&gt;
== Complete stock component reference ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;create( page, container_div, item_width, item_height ):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With create, you create a new stock component.&lt;br /&gt;
Parameters:&lt;br /&gt;
* page: the container page. Usually: &amp;quot;this&amp;quot;.&lt;br /&gt;
* container_div: the container &amp;quot;&amp;lt;div&amp;gt;&amp;quot; element (a void &amp;lt;div&amp;gt; element in your template, with an id).&lt;br /&gt;
* a stock item width and height, in pixels.&lt;br /&gt;
&lt;br /&gt;
(See &amp;quot;Hearts&amp;quot; example above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;count():&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return the total number of items in the stock right now.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addItemType( type, weight, image, image_position ):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Define a new type of item to the stock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is mandatory to define a new item type before adding it to the stock. Example: if you want to have a stock control that can contains cubes of 3 different colors, you must add 3 item types (one for each color).&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* type: ID of the type to add. You can choose any positive integer. All item types must have distinct IDs.&lt;br /&gt;
* weight: weight of items of this type. Weight value is used to sort items of the stock during the display. Note that you can specify the same weight for all items (in this case they are not sorted and their order might change randomly at any time).&lt;br /&gt;
* image: URL of item image. Most of the time, you will use a CSS sprite for stock item, so you have to specify CSS sprite image here.&lt;br /&gt;
&lt;br /&gt;
Be careful: you must specify the image url as this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  g_gamethemeurl+&#039;img/yourimage.png&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* image_position: if &amp;quot;image&amp;quot; specify the URL of a CSS sprite, you must specify the position of the item image in this CSS sprite. For example, if you have a CSS sprite with 3 cubes with a size of 20x20 pixels each (so your CSS image has for example a size of 20x60 or 60x20), you specify &amp;quot;0&amp;quot; for the first cube image, 1 for the second, 2 for the third.&lt;br /&gt;
Important: there are more than one line of items in your CSS sprite,  you must specify how many items per line you have in your CSS sprite like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Specify that there is 10 image items per row in images used in &amp;quot;myStockObject&amp;quot; control.&lt;br /&gt;
    this.myStockObject.image_items_per_row = 10;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addToStock( type, from )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add an item to the stock, with the specified type.&lt;br /&gt;
&lt;br /&gt;
To make your life easy, in most of the case we suggest you to use &amp;quot;addToStockWithId&amp;quot; in order to give an ID to the item added. &amp;quot;addToStock&amp;quot; is perfect when you are using a stock controls with items that are generic game material that does not need to be addressed individually (ex: a bunch of money tokens).&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* type: ID of the item type to use (as specified in &amp;quot;addItemType&amp;quot;)&lt;br /&gt;
* from: OPTIONNAL: if you specify a HTML item here, the item will appear on this item and will be slided to its position on the stock item.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  // Add a money token to the &amp;quot;player money&amp;quot; stock.&lt;br /&gt;
  // The money token will appear on &amp;quot;player_id&amp;quot; player panel and will move to its position.&lt;br /&gt;
  this.playerMoney.addToStock( MONEY_TOKEN, &#039;overall_player_board_&#039;+player_id );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Important: for a given stock control, you must use either addToStock or addToStockWithId, but NEVER BOTH OF THEM.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addToStockWithId( type, id, from )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is exactly the same method than &amp;quot;addToStock&amp;quot;, except that you associate an ID to the newly created item.&lt;br /&gt;
&lt;br /&gt;
This is especially useful:&lt;br /&gt;
* When you need to know which item(s) has been selected by the user (see &amp;quot;getSelectedItems&amp;quot;).&lt;br /&gt;
* When you need to remove a specific item from the stock with &amp;quot;removeFromStockById&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Important: for a given stock control, you must use either addToStock or addToStockWithId, but NEVER BOTH OF THEM.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;removeFromStock( type, to )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove an item of the specific type from the stock.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;to&amp;quot; is an optional parameter. If &amp;quot;to&amp;quot; contains the ID of an HTML element, the item removed from the stock is slided to this HTML element before it disappear.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;removeFromStockById( id, to )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove an item with a specific ID from the stock.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;to&amp;quot; is an optional parameter. If &amp;quot;to&amp;quot; contains the ID of an HTML element, the item removed from the stock is slided to this HTML element before it disappear.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;removeAll()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove all items from the stock.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPresentTypeList()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return an array with all the types of items present in the stock right now.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    this.myStockControl.removeAll();&lt;br /&gt;
    this.myStockControl.addToStock( 65 );&lt;br /&gt;
    this.myStockControl.addToStock( 34 );&lt;br /&gt;
    this.myStockControl.addToStock( 89 );&lt;br /&gt;
    this.myStockControl.addToStock( 65 );&lt;br /&gt;
    &lt;br /&gt;
    // The following returns: { 34:1,  65:1,  89:1  }&lt;br /&gt;
    var item_types = this.myStockControl.getPresentTypeList();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;resetItemsPosition()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you moved an item from the stock control manually (ex: after a drag&#039;n&#039;drop) and want to reset their position to their original ones, you can call this method.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;item_margin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By default, there is a margin of 5px between the items of a stock. You can change the member variable &amp;quot;item_margin&amp;quot; to change this.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     this.myStockControl.item_margin=5;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;changeItemsWeight( newWeights )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With this method you can change dynamically the weight of the item types in a stock control.&lt;br /&gt;
&lt;br /&gt;
Items are immediately re-sorted with the new weight.&lt;br /&gt;
&lt;br /&gt;
Example: with a stock control that contains classic cards, you can order them by value or by color. Using changeItemsWeight you can switch from one sort method to another when a player request this.&lt;br /&gt;
&lt;br /&gt;
newWeights is an associative array: item type id =&amp;gt; new weight.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Item type 1 gets a new weight of 10, 2 a new weight of 20, 3 a new weight of 30.&lt;br /&gt;
    this.myStockControl.changeItemsWeight( { 1: 10, 2: 20, 3: 30 } );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setSelectionMode( mode )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For each stock control, you can specify a selection mode:&lt;br /&gt;
* 0: no item can be selected by the player.&lt;br /&gt;
* 1: a maximum of one item can be selected by the player at the same time.&lt;br /&gt;
* 2: several items can be selected by the player at the same time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setSelectionAppeareance( type )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For each stock control, you can specify a selection highlighting type:&lt;br /&gt;
* &#039;border&#039;: there will be a red border around selected items (this is the default). The attribute &#039;apparenceBorderWidth&#039; can be used to manage the width of the border (in pixels).&lt;br /&gt;
* &#039;disappear&#039;: the selected item will fade out and disappear. This is useful when the selection has the effect of destroying the item.&lt;br /&gt;
* &#039;class&#039;: there will be an extra &#039;stockitem_selecte&#039; css class added to the element when it is selected (and removed when unselected). You can override this class in the css file for your game.&lt;br /&gt;
&lt;br /&gt;
By default this class definition is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.stockitem_selected {&lt;br /&gt;
	border: 2px solid red ! important;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to override it for example to change the border color add this in your &amp;lt;game&amp;gt;.css file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.stockitem_selected {&lt;br /&gt;
	border: 2px solid orange ! important;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: the &#039;class&#039; highlighting type has not yet been deployed on the studio - 24/02/2014. This warning will be removed after the next upgrade.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;isSelected( id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return true/false wether the specified item id has been selected or not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;selectItem( id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Select the specified item.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unselectItem( id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unselect the specified item.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unselectAll()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unselect all items of the stock.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;onChangeSelection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This callback method is called when the player select/unselect an item of the stock.&lt;br /&gt;
&lt;br /&gt;
You can connect this to one of your method like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    dojo.connect( this.myStockControl, &#039;onChangeSelection&#039;, this, &#039;onMyMethodToCall&#039; );&lt;br /&gt;
    &lt;br /&gt;
    (...)&lt;br /&gt;
    &lt;br /&gt;
    onMyMethodToCall: function( control_name )&lt;br /&gt;
    {&lt;br /&gt;
        // This method is called when myStockControl selected items changed&lt;br /&gt;
        var items = this.myStockControl.getSelectedItems();&lt;br /&gt;
        &lt;br /&gt;
        // (do something)&lt;br /&gt;
    },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;control_name&amp;quot; argument is the ID (the &amp;quot;DOM&amp;quot; id) of the &amp;lt;div&amp;gt; container of your stock control. Using &amp;quot;control_name&amp;quot;, you can use the same callback method for different Stock control and see which one trigger the method.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getSelectedItems()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return the list of selected items, as an array with the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[&lt;br /&gt;
   { type:1,  id:  1001 },&lt;br /&gt;
   { type:1,  id:  1002 },&lt;br /&gt;
   { type:3,  id:  1003 }&lt;br /&gt;
   ...&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getUnselectedItems()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as the previous one, but return unselected item instead of seleted ones.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getAllItems()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get all items (same format than getSelectedItems and getUnselectedItems).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setOverlap( horizontal_percent, vertical_percent )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make items on the stock control &amp;quot;overlap&amp;quot; on each other, to save space.&lt;br /&gt;
&lt;br /&gt;
By default, horizontal_overlap and vertical_overlap are 0.&lt;br /&gt;
&lt;br /&gt;
When horizontal_overlap=20, it means that a stock item must overlap on 20% of the width of the previous item. horizontal_overlap can&#039;t be over 100.&lt;br /&gt;
&lt;br /&gt;
vertical_overlap works differently: one items on two are shifted up.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Jaipur&amp;quot; game to see an example to use of this function.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;onItemCreate&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using onItemCreate, you can trigger a method each time a new item is added to the Stock, in order you can customize it.&lt;br /&gt;
&lt;br /&gt;
Complete example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // During &amp;quot;setup&amp;quot; phase, we associate our method &amp;quot;setupNewCard&amp;quot; with the creation of a new stock item:&lt;br /&gt;
    this.myStockItem.onItemCreate = dojo.hitch( this, &#039;setupNewCard&#039; ); &lt;br /&gt;
&lt;br /&gt;
     (...)&lt;br /&gt;
&lt;br /&gt;
    // And here is our &amp;quot;setupNewCard&amp;quot;:&lt;br /&gt;
    setupNewCard: function( card_div, card_type_id, card_id )&lt;br /&gt;
    {&lt;br /&gt;
       // Add a special tooltip on the card:&lt;br /&gt;
       this.addTooltip( card_div.id, _(&amp;quot;Some nice tooltip for this item&amp;quot;), &#039;&#039; );&lt;br /&gt;
&lt;br /&gt;
       // Note that &amp;quot;card_type_id&amp;quot; contains the type of the item, so you can do special actions depending on the item type&lt;br /&gt;
&lt;br /&gt;
       // Add some custom HTML content INSIDE the Stock item:&lt;br /&gt;
       dojo.place( this.format_block( &#039;jstpl_my_card_content&#039;, {&lt;br /&gt;
                                ....&lt;br /&gt;
                           } ), card_div.id );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips when adding/removing items to/from Stock components ==&lt;br /&gt;
&lt;br /&gt;
The usual way is the following:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Situation A&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
When you add a card to a stock item, and this card is &#039;&#039;&#039;not&#039;&#039;&#039; coming from another stock: use &amp;quot;addToStockWithId&amp;quot; with a &amp;quot;from&amp;quot; argument set to the element of your interface where card should come from.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Situation B&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
When you add a card to a stock item, and this card is coming from another stock:&lt;br /&gt;
* on the destination Stock, use &amp;quot;addToStockWithId&amp;quot; with a &amp;quot;from&amp;quot; equals to the HTML id of the corresponding item in the source Stock. For example, If the source stock id is &amp;quot;myHand&amp;quot;, then the HTML id of card 48 is &amp;quot;myHand_item_48&amp;quot;.&lt;br /&gt;
* then, remove the source item with &amp;quot;removeFromStockById&amp;quot;.&lt;br /&gt;
(note that it&#039;s important to do things in this order, because source item must still exists when you use it as the origin of the slide).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Situation C&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
When you move a card from a stock item to something that is not a stock item:&lt;br /&gt;
* insert the card as a classic HTML template (dojo.place / this.format_block).&lt;br /&gt;
* place it on the Stock item with &amp;quot;this.placeOnObject&amp;quot;, using Stock item HTML id (see above).&lt;br /&gt;
* slide it to its new position with &amp;quot;this.slideToObject&amp;quot;&lt;br /&gt;
* remove the card from the Stock item with &amp;quot;removeFromStockById&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Using the methods above, your cards should slide to, from and between your Stock controls smoothly&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Stock&amp;diff=1080</id>
		<title>Stock</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Stock&amp;diff=1080"/>
		<updated>2014-02-24T18:05:47Z</updated>

		<summary type="html">&lt;p&gt;Een: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;quot;Stock&amp;quot; is a javascript component that you can use on your game interface to display a set of elements of the same size that need to be arranged in one or several lines.&lt;br /&gt;
&lt;br /&gt;
Stock is very flexible and is the most used component in BGA games.&lt;br /&gt;
&lt;br /&gt;
Stock is used for example:&lt;br /&gt;
* To display set of cards, typically hands (ex: in Hearts, Seasons, The Boss, Race for the Galaxy, ...).&lt;br /&gt;
* To display items in player panels (ex: Takenoko, Amyitis, ...)&lt;br /&gt;
* ... in many other situations. For example, black dice and cubes on cards in Troyes are displayed with stock components.&lt;br /&gt;
&lt;br /&gt;
Using stock:&lt;br /&gt;
* Your items are arranged nicely and sorted by type.&lt;br /&gt;
* When adding (or removing) items to the set. All items slide smoothly to their new position in the set to host the new one.&lt;br /&gt;
* Select/unselect items is a built-in functionnality.&lt;br /&gt;
* You don&#039;t have to care about inserting/removing HTML piece of code: the entire life of the stock is managed by the component.&lt;br /&gt;
&lt;br /&gt;
== Using stock: a simple example ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s have a look on how the stock is used in game &amp;quot;Hearts&amp;quot; to display a hand of standard cards.&lt;br /&gt;
&lt;br /&gt;
At first, don&#039;t forget to add &amp;quot;ebg/stock&amp;quot; as a dependency:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/stock&amp;quot;     /// &amp;lt;==== HERE&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The stock is initialized in Javascript &amp;quot;setup&amp;quot; method like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Player hand&lt;br /&gt;
    this.playerHand = new ebg.stock();&lt;br /&gt;
    this.playerHand.create( this, $(&#039;myhand&#039;), this.cardwidth, this.cardheight );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanations:&lt;br /&gt;
* We create a new stock object for the player hand.&lt;br /&gt;
* As parameters of the &amp;quot;create&amp;quot; method, we provide the width/height of an item (=a card), and the container div &amp;quot;myhand&amp;quot; - which is a simple void &amp;quot;div&amp;quot; element defines in our HTML template (.tpl).&lt;br /&gt;
&lt;br /&gt;
Then, we must tell the stock what are the items it is going to display during its life: the 52 cards of a standard card game. Of course, we did not create 52 different images, but create a &amp;quot;CSS sprite&amp;quot; image named &amp;quot;cards.jpg&amp;quot; with all the cards arranged in 4 rows and 13 columns.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how we tell stock what are the items type to display:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Explain there are 13 images per row in the CSS sprite image&lt;br /&gt;
    this.playerHand.image_items_per_row = 13;&lt;br /&gt;
&lt;br /&gt;
    // Create cards types:&lt;br /&gt;
    for( var color=1;color&amp;lt;=4;color++ )&lt;br /&gt;
    {&lt;br /&gt;
        for( var value=2;value&amp;lt;=14;value++ )&lt;br /&gt;
        {&lt;br /&gt;
            // Build card type id&lt;br /&gt;
            var card_type_id = this.getCardUniqueId( color, value );&lt;br /&gt;
            this.playerHand.addItemType( card_type_id, card_type_id, g_gamethemeurl+&#039;img/cards.jpg&#039;, card_type_id );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanations:&lt;br /&gt;
* At first, we tell the stock component that our CSS sprite contains 13 items per row. This way, it can find the correct image for each card type id.&lt;br /&gt;
* Then for the 4x13 cards, we call &amp;quot;addItemType&amp;quot; method that create the type. The arguments are the type id, the weight of the card (for sorting purpose), the URL of our CSS sprite, and the position of our card image in the CSS sprite.&lt;br /&gt;
&lt;br /&gt;
Note: in this specific example we need to generate a unique ID for each type of card based on its color and value. This is the only purpose of &amp;quot;getCardUniqueId&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
From now, if we need to add - for example - the 5 of Heart to player&#039;s hand, we can do this.&lt;br /&gt;
this.playerHand.addToStock( this.getCardUniqueId( 2 /* 2=hearts */, 5 ) );&lt;br /&gt;
&lt;br /&gt;
In reality, cards have some IDs, which are useful to manipulate them. This is the reason we are using &amp;quot;addToStockWithId&amp;quot; instead:&lt;br /&gt;
this.playerHand.addToStock( this.getCardUniqueId( 2 /* 2=hearts */, 5 ), my_card_id );&lt;br /&gt;
&lt;br /&gt;
If afterwards we want to remove this card from the stock:&lt;br /&gt;
this.playerHand.removeFromStockById( my_card_id );&lt;br /&gt;
&lt;br /&gt;
== Complete stock component reference ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;create( page, container_div, item_width, item_height ):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With create, you create a new stock component.&lt;br /&gt;
Parameters:&lt;br /&gt;
* page: the container page. Usually: &amp;quot;this&amp;quot;.&lt;br /&gt;
* container_div: the container &amp;quot;&amp;lt;div&amp;gt;&amp;quot; element (a void &amp;lt;div&amp;gt; element in your template, with an id).&lt;br /&gt;
* a stock item width and height, in pixels.&lt;br /&gt;
&lt;br /&gt;
(See &amp;quot;Hearts&amp;quot; example above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;count():&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return the total number of items in the stock right now.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addItemType( type, weight, image, image_position ):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Define a new type of item to the stock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is mandatory to define a new item type before adding it to the stock. Example: if you want to have a stock control that can contains cubes of 3 different colors, you must add 3 item types (one for each color).&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* type: ID of the type to add. You can choose any positive integer. All item types must have distinct IDs.&lt;br /&gt;
* weight: weight of items of this type. Weight value is used to sort items of the stock during the display. Note that you can specify the same weight for all items (in this case they are not sorted and their order might change randomly at any time).&lt;br /&gt;
* image: URL of item image. Most of the time, you will use a CSS sprite for stock item, so you have to specify CSS sprite image here.&lt;br /&gt;
&lt;br /&gt;
Be careful: you must specify the image url as this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  g_gamethemeurl+&#039;img/yourimage.png&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* image_position: if &amp;quot;image&amp;quot; specify the URL of a CSS sprite, you must specify the position of the item image in this CSS sprite. For example, if you have a CSS sprite with 3 cubes with a size of 20x20 pixels each (so your CSS image has for example a size of 20x60 or 60x20), you specify &amp;quot;0&amp;quot; for the first cube image, 1 for the second, 2 for the third.&lt;br /&gt;
Important: there are more than one line of items in your CSS sprite,  you must specify how many items per line you have in your CSS sprite like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Specify that there is 10 image items per row in images used in &amp;quot;myStockObject&amp;quot; control.&lt;br /&gt;
    this.myStockObject.image_items_per_row = 10;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addToStock( type, from )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add an item to the stock, with the specified type.&lt;br /&gt;
&lt;br /&gt;
To make your life easy, in most of the case we suggest you to use &amp;quot;addToStockWithId&amp;quot; in order to give an ID to the item added. &amp;quot;addToStock&amp;quot; is perfect when you are using a stock controls with items that are generic game material that does not need to be addressed individually (ex: a bunch of money tokens).&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* type: ID of the item type to use (as specified in &amp;quot;addItemType&amp;quot;)&lt;br /&gt;
* from: OPTIONNAL: if you specify a HTML item here, the item will appear on this item and will be slided to its position on the stock item.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  // Add a money token to the &amp;quot;player money&amp;quot; stock.&lt;br /&gt;
  // The money token will appear on &amp;quot;player_id&amp;quot; player panel and will move to its position.&lt;br /&gt;
  this.playerMoney.addToStock( MONEY_TOKEN, &#039;overall_player_board_&#039;+player_id );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Important: for a given stock control, you must use either addToStock or addToStockWithId, but NEVER BOTH OF THEM.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addToStockWithId( type, id, from )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is exactly the same method than &amp;quot;addToStock&amp;quot;, except that you associate an ID to the newly created item.&lt;br /&gt;
&lt;br /&gt;
This is especially useful:&lt;br /&gt;
* When you need to know which item(s) has been selected by the user (see &amp;quot;getSelectedItems&amp;quot;).&lt;br /&gt;
* When you need to remove a specific item from the stock with &amp;quot;removeFromStockById&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Important: for a given stock control, you must use either addToStock or addToStockWithId, but NEVER BOTH OF THEM.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;removeFromStock( type, to )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove an item of the specific type from the stock.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;to&amp;quot; is an optional parameter. If &amp;quot;to&amp;quot; contains the ID of an HTML element, the item removed from the stock is slided to this HTML element before it disappear.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;removeFromStockById( id, to )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove an item with a specific ID from the stock.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;to&amp;quot; is an optional parameter. If &amp;quot;to&amp;quot; contains the ID of an HTML element, the item removed from the stock is slided to this HTML element before it disappear.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;removeAll()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove all items from the stock.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPresentTypeList()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return an array with all the types of items present in the stock right now.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    this.myStockControl.removeAll();&lt;br /&gt;
    this.myStockControl.addToStock( 65 );&lt;br /&gt;
    this.myStockControl.addToStock( 34 );&lt;br /&gt;
    this.myStockControl.addToStock( 89 );&lt;br /&gt;
    this.myStockControl.addToStock( 65 );&lt;br /&gt;
    &lt;br /&gt;
    // The following returns: { 34:1,  65:1,  89:1  }&lt;br /&gt;
    var item_types = this.myStockControl.getPresentTypeList();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;resetItemsPosition()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you moved an item from the stock control manually (ex: after a drag&#039;n&#039;drop) and want to reset their position to their original ones, you can call this method.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;item_margin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By default, there is a margin of 5px between the items of a stock. You can change the member variable &amp;quot;item_margin&amp;quot; to change this.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     this.myStockControl.item_margin=5;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;changeItemsWeight( newWeights )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With this method you can change dynamically the weight of the item types in a stock control.&lt;br /&gt;
&lt;br /&gt;
Items are immediately re-sorted with the new weight.&lt;br /&gt;
&lt;br /&gt;
Example: with a stock control that contains classic cards, you can order them by value or by color. Using changeItemsWeight you can switch from one sort method to another when a player request this.&lt;br /&gt;
&lt;br /&gt;
newWeights is an associative array: item type id =&amp;gt; new weight.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Item type 1 gets a new weight of 10, 2 a new weight of 20, 3 a new weight of 30.&lt;br /&gt;
    this.myStockControl.changeItemsWeight( { 1: 10, 2: 20, 3: 30 } );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setSelectionMode( mode )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For each stock control, you can specify a selection mode:&lt;br /&gt;
* 0: no item can be selected by the player.&lt;br /&gt;
* 1: a maximum of one item can be selected by the player at the same time.&lt;br /&gt;
* 2: several items can be selected by the player at the same time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;isSelected( id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return true/false wether the specified item id has been selected or not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;selectItem( id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Select the specified item.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unselectItem( id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unselect the specified item.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unselectAll()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unselect all items of the stock.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;onChangeSelection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This callback method is called when the player select/unselect an item of the stock.&lt;br /&gt;
&lt;br /&gt;
You can connect this to one of your method like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    dojo.connect( this.myStockControl, &#039;onChangeSelection&#039;, this, &#039;onMyMethodToCall&#039; );&lt;br /&gt;
    &lt;br /&gt;
    (...)&lt;br /&gt;
    &lt;br /&gt;
    onMyMethodToCall: function( control_name )&lt;br /&gt;
    {&lt;br /&gt;
        // This method is called when myStockControl selected items changed&lt;br /&gt;
        var items = this.myStockControl.getSelectedItems();&lt;br /&gt;
        &lt;br /&gt;
        // (do something)&lt;br /&gt;
    },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;control_name&amp;quot; argument is the ID (the &amp;quot;DOM&amp;quot; id) of the &amp;lt;div&amp;gt; container of your stock control. Using &amp;quot;control_name&amp;quot;, you can use the same callback method for different Stock control and see which one trigger the method.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getSelectedItems()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return the list of selected items, as an array with the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[&lt;br /&gt;
   { type:1,  id:  1001 },&lt;br /&gt;
   { type:1,  id:  1002 },&lt;br /&gt;
   { type:3,  id:  1003 }&lt;br /&gt;
   ...&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getUnselectedItems()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as the previous one, but return unselected item instead of seleted ones.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getAllItems()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get all items (same format than getSelectedItems and getUnselectedItems).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setOverlap( horizontal_percent, vertical_percent )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make items on the stock control &amp;quot;overlap&amp;quot; on each other, to save space.&lt;br /&gt;
&lt;br /&gt;
By default, horizontal_overlap and vertical_overlap are 0.&lt;br /&gt;
&lt;br /&gt;
When horizontal_overlap=20, it means that a stock item must overlap on 20% of the width of the previous item. horizontal_overlap can&#039;t be over 100.&lt;br /&gt;
&lt;br /&gt;
vertical_overlap works differently: one items on two are shifted up.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Jaipur&amp;quot; game to see an example to use of this function.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;onItemCreate&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using onItemCreate, you can trigger a method each time a new item is added to the Stock, in order you can customize it.&lt;br /&gt;
&lt;br /&gt;
Complete example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // During &amp;quot;setup&amp;quot; phase, we associate our method &amp;quot;setupNewCard&amp;quot; with the creation of a new stock item:&lt;br /&gt;
    this.myStockItem.onItemCreate = dojo.hitch( this, &#039;setupNewCard&#039; ); &lt;br /&gt;
&lt;br /&gt;
     (...)&lt;br /&gt;
&lt;br /&gt;
    // And here is our &amp;quot;setupNewCard&amp;quot;:&lt;br /&gt;
    setupNewCard: function( card_div, card_type_id, card_id )&lt;br /&gt;
    {&lt;br /&gt;
       // Add a special tooltip on the card:&lt;br /&gt;
       this.addTooltip( card_div.id, _(&amp;quot;Some nice tooltip for this item&amp;quot;), &#039;&#039; );&lt;br /&gt;
&lt;br /&gt;
       // Note that &amp;quot;card_type_id&amp;quot; contains the type of the item, so you can do special actions depending on the item type&lt;br /&gt;
&lt;br /&gt;
       // Add some custom HTML content INSIDE the Stock item:&lt;br /&gt;
       dojo.place( this.format_block( &#039;jstpl_my_card_content&#039;, {&lt;br /&gt;
                                ....&lt;br /&gt;
                           } ), card_div.id );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips when adding/removing items to/from Stock components ==&lt;br /&gt;
&lt;br /&gt;
The usual way is the following:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Situation A&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
When you add a card to a stock item, and this card is &#039;&#039;&#039;not&#039;&#039;&#039; coming from another stock: use &amp;quot;addToStockWithId&amp;quot; with a &amp;quot;from&amp;quot; argument set to the element of your interface where card should come from.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Situation B&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
When you add a card to a stock item, and this card is coming from another stock:&lt;br /&gt;
* on the destination Stock, use &amp;quot;addToStockWithId&amp;quot; with a &amp;quot;from&amp;quot; equals to the HTML id of the corresponding item in the source Stock. For example, If the source stock id is &amp;quot;myHand&amp;quot;, then the HTML id of card 48 is &amp;quot;myHand_item_48&amp;quot;.&lt;br /&gt;
* then, remove the source item with &amp;quot;removeFromStockById&amp;quot;.&lt;br /&gt;
(note that it&#039;s important to do things in this order, because source item must still exists when you use it as the origin of the slide).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Situation C&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
When you move a card from a stock item to something that is not a stock item:&lt;br /&gt;
* insert the card as a classic HTML template (dojo.place / this.format_block).&lt;br /&gt;
* place it on the Stock item with &amp;quot;this.placeOnObject&amp;quot;, using Stock item HTML id (see above).&lt;br /&gt;
* slide it to its new position with &amp;quot;this.slideToObject&amp;quot;&lt;br /&gt;
* remove the card from the Stock item with &amp;quot;removeFromStockById&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Using the methods above, your cards should slide to, from and between your Stock controls smoothly&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Game_interface_logic:_yourgamename.js&amp;diff=1079</id>
		<title>Game interface logic: yourgamename.js</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Game_interface_logic:_yourgamename.js&amp;diff=1079"/>
		<updated>2014-02-24T17:49:33Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Scoring dialogs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the main file for your game interface. Here you will define:&lt;br /&gt;
&lt;br /&gt;
* which actions on the page will generate calls to the server&lt;br /&gt;
* what happens when you get a notification for change from the server and how it will show in the browser. &lt;br /&gt;
&lt;br /&gt;
== File structure ==&lt;br /&gt;
&lt;br /&gt;
The details on how the file is structured is described directly with comments on the code skeleton provided to you.&lt;br /&gt;
&lt;br /&gt;
Basically, here&#039;s this structure:&lt;br /&gt;
* constructor: here you can define variable global to your whole interface.&lt;br /&gt;
* setup: this method is called when the page is refreshed, in order you can setup the game interface.&lt;br /&gt;
* onEnteringState: the method is called when entering in a new game state. This way you can customize the view for this game state.&lt;br /&gt;
* onLeavingState: the method is called when leaving a game state.&lt;br /&gt;
* onUpdateActionButtons: called when entering in a new state, in order you can add action buttons in status bar.&lt;br /&gt;
* (utility methods): at this place you can define your utility methods&lt;br /&gt;
* (player&#039;s actions): at this place you can write your handlers for player&#039;s action on the interface (ex: click on an item).&lt;br /&gt;
* setupNotifications: in this method you associate notifications with notification handlers. This way, for each game notification, you trigger a javascript method to handle it and update the game interface.&lt;br /&gt;
* (notification handlers): at this place you can define your notifications handlers.&lt;br /&gt;
&lt;br /&gt;
== General tips ==&lt;br /&gt;
&lt;br /&gt;
; this.player_id&lt;br /&gt;
: Id of the player on whose browser the code is running.&lt;br /&gt;
&lt;br /&gt;
; this.isSpectator&lt;br /&gt;
: Flag set to true if the user at the table is a spectator (not a player).&lt;br /&gt;
: Note: if you want to hide some element for spectators, you&#039;d better use [[Game_interface_stylesheet:_yourgamename.css#spectatorMode|CSS &#039;spectatorMode&#039; class]].&lt;br /&gt;
&lt;br /&gt;
; this.gamedatas&lt;br /&gt;
: Contains your initial set of datas to init the game, created at game start or game refresh (F5)&lt;br /&gt;
: You can update it as needed to keep an up to date reference of the game on the client side if you need it (most of the time you don&#039;t).&lt;br /&gt;
&lt;br /&gt;
; isCurrentPlayerActive()&lt;br /&gt;
: Returns true if the player on whose browser the code is running is currently active (it&#039;s his turn to play)&lt;br /&gt;
&lt;br /&gt;
; this.getActivePlayerId()&lt;br /&gt;
: Return the ID of active player, or null if we are not in a &amp;quot;activeplayer&amp;quot; type state.&lt;br /&gt;
&lt;br /&gt;
; this.getActivePlayers()&lt;br /&gt;
: Return an array with the IDs of players that are currently active (or an empty array if there is not).&lt;br /&gt;
&lt;br /&gt;
== Dojo framework ==&lt;br /&gt;
&lt;br /&gt;
BGA is using the [http://dojotoolkit.org/ Dojo Javascript framework].&lt;br /&gt;
&lt;br /&gt;
The Dojo framework allows us to do complex things easier, and the BGA framework is using Dojo framework a lot.&lt;br /&gt;
&lt;br /&gt;
To realize game although, you only need to use a few part of the Dojo framework. All the Dojo methods you need to use are describe on this page.&lt;br /&gt;
&lt;br /&gt;
== Access and manipulate the DOM ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$(&#039;some_html_element_id&#039;)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The $() function is used to get some HTML element using its &amp;quot;id&amp;quot; attribute.&lt;br /&gt;
&lt;br /&gt;
Example 1: modify the content of a &amp;quot;span&amp;quot; element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
In your HTML code:&lt;br /&gt;
   &amp;lt;span id=&amp;quot;a_value_in_the_game_interface&amp;quot;&amp;gt;1234&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In your Javascript code:&lt;br /&gt;
   $(&#039;a_value_in_the_game_interface&#039;).innerHTML = &amp;quot;9999&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: $() is the standard method to access some HTML element with BGA Framework. You must not use &amp;quot;getElementById&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.style&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With dojo.style you can modify a CSS property of any HTML element of your interface.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // Make an element disappear&lt;br /&gt;
     dojo.style( &#039;my_element&#039;, &#039;display&#039;, &#039;none&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Give an element a 2px border&lt;br /&gt;
     dojo.style( &#039;my_element&#039;, &#039;borderWidth&#039;, &#039;2px&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Change the background position of an element&lt;br /&gt;
     // (very practical when you are using CSS sprite to transform an element to another)&lt;br /&gt;
     dojo.style( &#039;my_element&#039;, &#039;backgroundPosition&#039;, &#039;-20px -50px&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: you must always use dojo.style to modify CSS properties of HTML elements.&lt;br /&gt;
&lt;br /&gt;
Note²: if you have to modify several CSS properties of an element, or if you have some complex CSS transformation to do, you should consider using dojo.addClass/dojo.removeClass (see below).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo CSS classes manipulation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In many situation, a bunch of many small CSS property update can be replaced by a CSS class change (ie: you add a CSS class to your element instead of applying all modification manually).&lt;br /&gt;
&lt;br /&gt;
Advantages are:&lt;br /&gt;
* All your CSS stuff remains in your CSS file.&lt;br /&gt;
* You can add/remove a list of CSS modifications with a simple function and whithout error.&lt;br /&gt;
* You can test if you applied the stuff to an element with &amp;quot;dojo.hasClass&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Example from &amp;quot;Reversi&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // We add &amp;quot;possibleMove&amp;quot; to an element&lt;br /&gt;
    dojo.addClass( &#039;square_&#039;+x+&#039;_&#039;+y, &#039;possibleMove&#039; );&lt;br /&gt;
&lt;br /&gt;
    // In our CSS file, the class is defined as:&lt;br /&gt;
    .possibleMove {&lt;br /&gt;
      background-color: white;&lt;br /&gt;
      opacity: 0.2;&lt;br /&gt;
      filter:alpha(opacity=20); /* For IE8 and earlier */  &lt;br /&gt;
      cursor: pointer;  &lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     // So we&#039;ve applied 4 CSS property change in one line of code.&lt;br /&gt;
&lt;br /&gt;
     // ... and when we need to check if a square is a possible move on client side:&lt;br /&gt;
     if( dojo.hasClass( &#039;square_&#039;+x+&#039;_&#039;+y, &#039;possibleMove&#039; ) )&lt;br /&gt;
     { ... }&lt;br /&gt;
&lt;br /&gt;
     // ... and if we want to remove all possible moves in one line of code (see &amp;quot;dojo.query&amp;quot; method):&lt;br /&gt;
     dojo.query( &#039;.possibleMove&#039; ).removeClass( &#039;possibleMove&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conclusion: we encourage you to use dojo.addClass, dojo.removeClass and dojo.hasClass to make your life easier :)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.query&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With dojo.query, you can query a bunch of HTML elements with a single function, with a &amp;quot;CSS selector&amp;quot; style.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // All elements with class &amp;quot;possibleMove&amp;quot;:&lt;br /&gt;
     var elements = dojo.query( &#039;.possibleMove&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Count number of tokens (ie: elements with class &amp;quot;token&amp;quot;) on the board (ie: element with id &amp;quot;board&amp;quot;):&lt;br /&gt;
     dojo.query( &#039;#board .token&#039; ).length;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But what is really cool with dojo.query is that you can combine it with almost all methods above.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // Trigger a method when the mouse enter in any element with class &amp;quot;meeple&amp;quot;:&lt;br /&gt;
     dojo.query( &#039;.meeple&#039; ).connect( &#039;onmouseenter&#039;, this, &#039;myMethodToTrigger&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Hide all meeples who are on the board&lt;br /&gt;
     dojo.query( &#039;#board .meeple&#039; ).style( &#039;display&#039;, &#039;none&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.place&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
dojo.place is the best function to insert some HTML code somewhere in your game interface without breaking something. It is much better to use that &amp;quot;innerHTML=&#039;&#039;&amp;quot; method as soon as you must insert HTML tags and not only values.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // Insert your HTML code as a child of a container element&lt;br /&gt;
     dojo.place( &amp;quot;&amp;lt;your html code&amp;gt;&amp;quot;, &amp;quot;your_container_element_id&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
     // Replace the container element with your new html&lt;br /&gt;
     dojo.place( &amp;quot;&amp;lt;your html code&amp;gt;&amp;quot;, &amp;quot;your_container_element_id&amp;quot;, &amp;quot;replace&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the third parameter of dojo.place can take various interesting value: &amp;quot;first&amp;quot;, &amp;quot;after&amp;quot;, ... [http://dojotoolkit.org/reference-guide/1.7/dojo/place.html See full doc on dojo.place].&lt;br /&gt;
&lt;br /&gt;
Usually, when you want to insert some piece of HTML in your game interface, you should use &amp;quot;[[Game_layout:_view_and_template:_yourgamename.view.php_and_yourgamename_yourgamename.tpl#Javascript_templates|Javascript templates]]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addStyleToClass: function( cssClassName, cssProperty, propertyValue )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as dojo.style(), but for all the nodes set with the specified cssClassName&lt;br /&gt;
&lt;br /&gt;
=== Animations ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dojo Animations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
BGA animations is based on Dojo Animation ([http://dojotoolkit.org/documentation/tutorials/1.8/animation/ see tutorial here]).&lt;br /&gt;
&lt;br /&gt;
However, most of the time, you can just use methods below, which are built on top of Dojo Animation.&lt;br /&gt;
&lt;br /&gt;
Note: one interesting method from Dojo that could be useful from time to time is &amp;quot;Dojo.Animation&amp;quot;. It allows you to make any CSS property &amp;quot;slide&amp;quot; from one value to another.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideToObject( mobile_obj, target_obj, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use slideToObject to &amp;quot;slide&amp;quot; an element to a target position.&lt;br /&gt;
&lt;br /&gt;
Sliding element on the game area is the recommended and the most used way to animate your game interface. Using slides allow players to figure out what is happening on the game, as if they were playing with the real boardgame.&lt;br /&gt;
&lt;br /&gt;
The parameters are:&lt;br /&gt;
* mobile_obj: the ID of the object to move. This object must be &amp;quot;relative&amp;quot; or &amp;quot;absolute&amp;quot; positioned.&lt;br /&gt;
* target_obj: the ID of the target object. This object must be &amp;quot;relative&amp;quot; or &amp;quot;absolute&amp;quot; positioned. Note that it is not mandatory that mobile_obj and target_obj have the same size. If their size are different, the system slides the center of mobile_obj to the center of target_obj.&lt;br /&gt;
* duration: (optional) defines the duration in millisecond of the slide. The default is 500 milliseconds.&lt;br /&gt;
* delay: (optional). If you defines a delay, the slide will start only after this delay. This is particularly useful when you want to slide several object from the same position to the same position: you can give a 0ms delay to the first object, a 100ms delay to the second one, a 200ms delay to the third one, ... this way they won&#039;t be superposed during the slide.&lt;br /&gt;
&lt;br /&gt;
BE CAREFUL: The method returns an dojo.fx animation, so you can combine it with other animation if you want to. It means that you have to call the &amp;quot;play()&amp;quot; method, otherwise the animation WON&#039;T START.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.slideToObject( &amp;quot;some_token&amp;quot;, &amp;quot;some_place_on_board&amp;quot; ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideToObjectPos( mobile_obj, target_obj, target_x, target_y, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method does exactly the same than &amp;quot;slideToObjectPos&amp;quot;, except than you can specify some (x,y) coordinates. This way, &amp;quot;mobile_obj&amp;quot; will slide to the specified x,y position relatively to &amp;quot;target_obj&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example: slide a token to some place on the board, 10 pixels to the bottom:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.slideToObjectPos( &amp;quot;some_token&amp;quot;, &amp;quot;some_place_on_board&amp;quot;, 0, 10 ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideTemporaryObject( mobile_obj_html, mobile_obj_parent, from, to, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is useful when you want to slide a temporary HTML object from one place to another. As this object does not exists before the animation and won&#039;t remain after, it could be complex to create this object (with dojo.place), to place it at its origin (with placeOnObject) to slide it (with slideToObject) and to make it disappear at the end.&lt;br /&gt;
&lt;br /&gt;
slideTemporaryObject does all of this for you:&lt;br /&gt;
* mobile_obj_html is a piece of HTML code that represent the object to slide.&lt;br /&gt;
* mobile_obj_parent is the ID of an HTML element of your interface that will be the parent of this temporary HTML object.&lt;br /&gt;
* from is the ID of the origin of the slide.&lt;br /&gt;
* to is the ID of the target of the slide.&lt;br /&gt;
* duration/delay works exactly like in &amp;quot;slideToObject&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.slideTemporaryObject( &#039;&amp;lt;div class=&amp;quot;token_icon&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&#039;, &#039;tokens&#039;, &#039;my_origin_div&#039;, &#039;my_target_div&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideToObjectAndDestroy: function( node, to, time, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is a handy shortcut to slide an existing HTML object to some place then destroy it upon arrival. It can be used for example to move a victory token or a card from the board to the player panel to show that the player earns it, then destroy it when we don&#039;t need to keep it visible on the player panel.&lt;br /&gt;
&lt;br /&gt;
It works the same as this.slideToObject and takes the same arguments. &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.slideToObjectAndDestroy( &amp;quot;some_token&amp;quot;, &amp;quot;some_place_on_board&amp;quot;, 1000, 0 ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.fadeOutAndDestroy( node )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function fade out the target HTML node, then destroy it.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.fadeOutAndDestroy( &amp;quot;a_card_that_must_disappear&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CAREFUL: the HTML node still exists until during few milliseconds, until the fadeOut has been completed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rotating elements&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can check here [http://jimfulton.info/demos/dojo-animated-rotate.html an example of use] of Dojo to make an element rotate.&lt;br /&gt;
&lt;br /&gt;
This example combines &amp;quot;Dojo.Animation&amp;quot; method and a CSS3 property that allow you to rotate the element.&lt;br /&gt;
&lt;br /&gt;
IMPORTANT: to asses browser compatibility, you must select the CSS property to use just like in the example (see sourcecode below):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        var transform;&lt;br /&gt;
        dojo.forEach(&lt;br /&gt;
            [&#039;transform&#039;, &#039;WebkitTransform&#039;, &#039;msTransform&#039;,&lt;br /&gt;
             &#039;MozTransform&#039;, &#039;OTransform&#039;],&lt;br /&gt;
            function (name) {&lt;br /&gt;
                if (typeof dojo.body().style[name] != &#039;undefined&#039;) {&lt;br /&gt;
                    transform = name;&lt;br /&gt;
                }&lt;br /&gt;
            });&lt;br /&gt;
        // ... and then use &amp;quot;transform&amp;quot; as the name of your CSS property for rotation&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Moving elements ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.placeOnObject( mobile_obj, target_obj )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
placeOnObject works exactly like &amp;quot;slideToObject&amp;quot;, except that the effect is immediate.&lt;br /&gt;
&lt;br /&gt;
This is not really an animation, but placeOnObject is frequently used before starting an animation.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  // (We just created an object &amp;quot;my_new_token&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  // Place the new token on current player board&lt;br /&gt;
  this.placeOnObject( &amp;quot;my_new_token&amp;quot;, &amp;quot;overall_player_board_&amp;quot;+this.player_id );&lt;br /&gt;
  &lt;br /&gt;
  // Then slide it to its position on the board&lt;br /&gt;
  this.slideToObject( &amp;quot;my_new_token&amp;quot;, &amp;quot;a_place_on_board&amp;quot; ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.placeOnObjectPos( mobile_obj, target_obj, target_x, target_y )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method works exactly like placeOnObject, except than you can specify some (x,y) coordinates. This way, &amp;quot;mobile_obj&amp;quot; will be placed to the specified x,y position relatively to &amp;quot;target_obj&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.attachToNewParent( mobile_obj, target_obj )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With this method, you change the HTML parent of &amp;quot;mobile_obj&amp;quot; element. &amp;quot;target_obj&amp;quot; is the new parent of this element. The beauty of &lt;br /&gt;
attachToNewParent is that the mobile_obj element DOES NOT MOVE during this process.&lt;br /&gt;
&lt;br /&gt;
Note: what happens is that the method calculate a relative position of mobile_obj to make sure it does not move after the HTML parent changes.&lt;br /&gt;
&lt;br /&gt;
Why using this method?&lt;br /&gt;
&lt;br /&gt;
Changing the HTML parent of an element can be useful for the following reasons:&lt;br /&gt;
* When the HTML parent moves, all its child are moving with them. If some game elements is no more linked with a parent HTML object, you may want to attach it to another place.&lt;br /&gt;
* The z_order (vertical order of display) depends on the position in the DOM, so you may need to change the parent of some game elements when they are moving in your game area.&lt;br /&gt;
&lt;br /&gt;
CAREFUL: when you attach an HTML element with a new parent, you break all references to this HTML element (ex: dojo.connect).&lt;br /&gt;
&lt;br /&gt;
== Players input ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.connect&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Used to associate a player event with one of your notification method.&lt;br /&gt;
&lt;br /&gt;
Example: associate a click on an element (&amp;quot;my_element&amp;quot;) with one of our method (&amp;quot;onClickOnMyElement&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      dojo.connect( $(&#039;my_element&#039;), &#039;onclick&#039;, this, &#039;onClickOnMyElement&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: this is the only possible correct way to associate a player input event to your code, and you must not use anything else.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.checkAction( &amp;quot;my_action_name&amp;quot; )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Usage: checkAction: function( action, nomessage )&lt;br /&gt;
&lt;br /&gt;
Check if player can do the specified action by taking into account:&lt;br /&gt;
* current game state&lt;br /&gt;
* interface locking (a player can&#039;t do any action if an action is already in progress)&lt;br /&gt;
&lt;br /&gt;
return true if action is authorized (ie: the action is listed as a &amp;quot;possibleaction&amp;quot; in current game state).&lt;br /&gt;
&lt;br /&gt;
return false and display an error message if not (display no message if nomessage parameter is true). The displayed error message could be either &amp;quot;This move is not allowed at this moment&amp;quot; or &amp;quot;An action is already in progress&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  function onClickOnGameElement( evt )&lt;br /&gt;
  {&lt;br /&gt;
     if( this.checkAction( &amp;quot;my_action&amp;quot; ) )&lt;br /&gt;
     {&lt;br /&gt;
        // Do the action&lt;br /&gt;
     }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.ajaxcall( url, parameters, obj_callback, callback, callback_error )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method must be used to send a player input to the game server.&lt;br /&gt;
&lt;br /&gt;
* url: the url of the action to perform. For a game, it must be: &amp;quot;/&amp;lt;mygame&amp;gt;/&amp;lt;mygame&amp;gt;/myAction.html&amp;quot;&lt;br /&gt;
* parameters: an array of parameter to send to the game server. Note that &amp;quot;lock:true&amp;quot; must always be specified in this list of parameter in order the interface can be locked during the server call.&lt;br /&gt;
* obj_callback: must be set to &amp;quot;this&amp;quot;.&lt;br /&gt;
* callback: a function to trigger when the server returns and everything went fine.&lt;br /&gt;
* callback_error: (optional and rarely used) a function to trigger when the server returns an error.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.ajaxcall( &#039;/mygame/mygame/myaction.html&#039;, { lock: true, &lt;br /&gt;
   arg1: myarg1, &lt;br /&gt;
   arg2: myarg2, &lt;br /&gt;
   ...&lt;br /&gt;
}, this, function( result ) {&lt;br /&gt;
   // Do some stuff after a successful call&lt;br /&gt;
} );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restricted arguments names (please don&#039;t use them):&lt;br /&gt;
* &amp;quot;action&amp;quot;&lt;br /&gt;
* &amp;quot;module&amp;quot;&lt;br /&gt;
* &amp;quot;class&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.confirmationDialog()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Display a confirmation dialog with a yes/no choice.&lt;br /&gt;
&lt;br /&gt;
We advice you to NOT use this function unless the player action is really critical and could ruins the game, because it slows down the game and upset players.&lt;br /&gt;
&lt;br /&gt;
Usage: this.confirmationDialog( &amp;quot;Question to displayed&amp;quot;, callback_function_if_click_on_yes );&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.confirmationDialog( _(&#039;Are you sure to use this bonus (points penalty at the end of the game) ?&#039;),&lt;br /&gt;
                         dojo.hitch( this, function() {&lt;br /&gt;
                           this.ajaxcall( &#039;/seasons/seasons/useBonus.html&#039;,&lt;br /&gt;
                                { id:bonus_id, lock:true }, this, function( result ) {} );&lt;br /&gt;
                        } ) ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; addEventToClass: function( cssClassName, eventName, functionName )&lt;br /&gt;
: Same as dojo.connect(), but for all the nodes set with the specified cssClassName&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addActionButton( id, label, method, (opt)depreciated, (opt)bHighlight )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use this method to add an action button in the main action status bar.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* id: a ID that should be unique in your HTML DOM document.&lt;br /&gt;
* label: the text of the button. Should be translatable (use _() function).&lt;br /&gt;
* method: the name of your method that must be triggered when the player clicks on this button.&lt;br /&gt;
* depreciated (optional): do not use this. Please not specify this argument or use &amp;quot;null&amp;quot;.&lt;br /&gt;
* bHighlight: if set to &amp;quot;true&amp;quot;, the button is going blink to catch player&#039;s attention. Please don&#039;t abuse of blinking button.&lt;br /&gt;
&lt;br /&gt;
You should only use this method in your &amp;quot;onUpdateActionButtons&amp;quot; method. Usually, you use it like this (from Hears example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        onUpdateActionButtons: function( stateName, args )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &#039;onUpdateActionButtons: &#039;+stateName );&lt;br /&gt;
                      &lt;br /&gt;
            if( this.isCurrentPlayerActive() )&lt;br /&gt;
            {            &lt;br /&gt;
                switch( stateName )&lt;br /&gt;
                {&lt;br /&gt;
                case &#039;giveCards&#039;:&lt;br /&gt;
                    this.addActionButton( &#039;giveCards_button&#039;, _(&#039;Give selected cards&#039;), &#039;onGiveCards&#039; ); &lt;br /&gt;
                    break;&lt;br /&gt;
&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        },   &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example above, we are adding a &amp;quot;Give selected cards&amp;quot; button in the case we are on game state &amp;quot;giveCards&amp;quot;. When player clicks on this button, it triggers our &amp;quot;onGiveCards&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
See [[Translations]]&lt;br /&gt;
&lt;br /&gt;
== Notifications ==&lt;br /&gt;
&lt;br /&gt;
When something happens on the server side, your game interface Javascript logic received a notification.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how you can handle these notifications on the client side.&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to notifications ===&lt;br /&gt;
&lt;br /&gt;
Your Javascript &amp;quot;setupNotifications&amp;quot; method is the place where you can subscribe to notifications from your PHP code.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how you associate one of your Javascript method to a notification &amp;quot;playDisc&amp;quot; (from Reversi example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   // In setupNotifications method:&lt;br /&gt;
   dojo.subscribe( &#039;playDisc&#039;, this, &amp;quot;notif_playDisc&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the &amp;quot;playDisc&amp;quot; corresponds to the name of the notification you define it in your PHP code, in your &amp;quot;notifyAllPlayers&amp;quot; or &amp;quot;notifyPlayer&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Then, you have to define your &amp;quot;notif_playDisc&amp;quot; method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        notif_playDisc: function( notif )&lt;br /&gt;
        {&lt;br /&gt;
            // Remove current possible moves (makes the board more clear)&lt;br /&gt;
            dojo.query( &#039;.possibleMove&#039; ).removeClass( &#039;possibleMove&#039; );        &lt;br /&gt;
        &lt;br /&gt;
            this.addDiscOnBoard( notif.args.x, notif.args.y, notif.args.player_id );&lt;br /&gt;
        },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a notification handler like our &amp;quot;notif_playDisc&amp;quot; method, you can access to all notifications arguments with &amp;quot;notif.args&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // If you did this on PHP side:&lt;br /&gt;
    self::notifyAllPlayers( &amp;quot;myNotification&amp;quot;, &#039;&#039;, array( &amp;quot;myArgument&amp;quot; =&amp;gt; 3 ) );&lt;br /&gt;
&lt;br /&gt;
    // On Javascript side, you can access the &amp;quot;myArgument&amp;quot; like this:&lt;br /&gt;
    notif_myNotification: function( notif )&lt;br /&gt;
    {&lt;br /&gt;
       alert( &amp;quot;myArgument = &amp;quot; + notif.args.myArgument );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Synchronous notifications ===&lt;br /&gt;
&lt;br /&gt;
When several notifications are received by your game interface, these notifications are processed immediately, one after the other, in the same exact order they have been generated in your PHP game logic.&lt;br /&gt;
&lt;br /&gt;
However, sometimes, you need to give some time to the players to figure out what happened on the game before jumping to the next notification. Indeed, in many games, they are a lot of automatic actions, and the computer is going to resolve all these actions very fast if you don&#039;t tell it not to do so.&lt;br /&gt;
&lt;br /&gt;
As an example, for Reversi, when someone is playing a disc, we want to wait 500 milliseconds before doing anything else in order the opponent player can figure out what move has been played.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how we do this, right after our subscription:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       dojo.subscribe( &#039;playDisc&#039;, this, &amp;quot;notif_playDisc&amp;quot; );&lt;br /&gt;
       this.notifqueue.setSynchronous( &#039;playDisc&#039;, 500 );   // Wait 500 milliseconds after executing the playDisc handler&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tooltips ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltip( nodeId, _( helpString ), _( actionString ), delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add a simple text tooltip to the DOM node.&lt;br /&gt;
&lt;br /&gt;
Specify &#039;helpString&#039; to display some information about &amp;quot;what is this game element?&amp;quot;.&lt;br /&gt;
Specify &#039;actionString&#039; to display some information about &amp;quot;what happens when I click on this element?&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You must specify both helpString and actionString. Most of the time, you use only one and specify a void string (&amp;quot;&amp;quot;) for the other one.&lt;br /&gt;
&lt;br /&gt;
Usually, _() must be used for the text to be marked for translation.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Delay&amp;quot; is an optional parameter. Usually, it is primarily used to specify a zero delay for some game element when the tooltip gives really important information for the game - but remember: no essential information must be placed in tooltips as they won&#039;t be displayed in some browser (see Guidelines).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.addTooltip( &#039;cardcount&#039;, _(&#039;Number of cards in hand&#039;), &#039;&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltipHtml( nodeId, html, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add an HTML tooltip to the DOM node (for more elaborate content such as presenting a bigger version of a card).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltipToClass( cssClass, _( helpString ), _( actionString ), delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add a simple text tooltip to all the DOM nodes set with this cssClass. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT: all concerned nodes must have IDs to get tooltips.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addTooltipHtmlToClass( cssClass, html, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add an HTML tooltip to to all the DOM nodes set with this cssClass (for more elaborate content such as presenting a bigger version of a card).&lt;br /&gt;
&lt;br /&gt;
IMPORTANT: all concerned nodes must have IDs to get tooltips&lt;br /&gt;
&lt;br /&gt;
== Dialogs, warning messages, confirmation dialogs, ... ==&lt;br /&gt;
&lt;br /&gt;
=== Warning messages ===&lt;br /&gt;
&lt;br /&gt;
Sometimes, there is something important that is happening on the game and you have to make sure all players get the message. Most of the time, the evolution of the game situation or the game log is enough, but sometimes you need something more visible.&lt;br /&gt;
&lt;br /&gt;
Ex: someone fulfill one of the end of the game condition, so this is the last turn.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.showMessage( msg, type )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
showMessage shows a message in a big rectangular area on the top of the screen of current player.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;msg&amp;quot; is the string to display. It should be translated.&lt;br /&gt;
* &amp;quot;type&amp;quot; can be set to &amp;quot;info&amp;quot; or &amp;quot;error&amp;quot;. If set to &amp;quot;info&amp;quot;, the message will be an informative message on a white background. If set to &amp;quot;error&amp;quot;, the message will be an error message on a red background.&lt;br /&gt;
&lt;br /&gt;
Important: the normal way to inform players about the progression of the game is the game log. &amp;quot;showMessage&amp;quot; is intrusive and should not be used often.&lt;br /&gt;
&lt;br /&gt;
=== Confirmation dialog ===&lt;br /&gt;
&lt;br /&gt;
When an important action with a lot of consequences is triggered by the player, you may want to propose a confirmation dialog.&lt;br /&gt;
&lt;br /&gt;
CAREFUL: the general guidelines of BGA is to AVOID the use of confirmation dialog. Confirmation dialogs slow down the game and bother players. The players knows that they have to pay attention about each move when they are playing online.&lt;br /&gt;
&lt;br /&gt;
The situation where you should use a confirmation dialog are the following:&lt;br /&gt;
* It must not happen very often during a game.&lt;br /&gt;
* It must be linked to an action that can really &amp;quot;kill a game&amp;quot; if the player do not pay attention.&lt;br /&gt;
* It must be something that can be done by mistake (ex: a link on the action status bar).&lt;br /&gt;
&lt;br /&gt;
How to display a confirmation dialog:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        this.confirmationDialog( _(&#039;Are you sure you want to make this?&#039;), dojo.hitch( this, function() {&lt;br /&gt;
            this.ajaxcall( &#039;/mygame/mygame/makeThis.html&#039;, { lock:true }, this, function( result ) {} );&lt;br /&gt;
        } ) );   &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dialogs ===&lt;br /&gt;
&lt;br /&gt;
At first, you shouldn&#039;t use dialogs windows.&lt;br /&gt;
&lt;br /&gt;
BGA guidelines specify that all game elements should be displayed on the main screen. Players can eventually scroll down to see game elements they don&#039;t need to see anytime, and you may eventually create anchors to move between game area section. Of course dialogs windows are very practical, but the thing is: all players know how to scroll down, and not all players know how to show up your dialog window. In addition, when the dialog shows up, players can&#039;t access the other game components.&lt;br /&gt;
&lt;br /&gt;
Sometimes although, you need to display a dialog window. Here is how you do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  // Create the new dialog. You should store the handler in a member variable to access it later&lt;br /&gt;
  this.myDlg = new dijit.Dialog({ title: _(&amp;quot;my dialog title to translate&amp;quot;) });&lt;br /&gt;
&lt;br /&gt;
  // Create the HTML of my dialog. The best practice here is to use [[Game_layout:_view_and_template:_yourgamename.view.php_and_yourgamename_yourgamename.tpl#Javascript_templates|Javascript templates]]:&lt;br /&gt;
  var html = this.format_block( &#039;jstpl_myDialogTemplate&#039;, { &lt;br /&gt;
                arg1: myArg1,&lt;br /&gt;
                arg2: myArg2,&lt;br /&gt;
                ...&lt;br /&gt;
            } );  &lt;br /&gt;
&lt;br /&gt;
  // Show the dialog&lt;br /&gt;
  this.myDlg.attr(&amp;quot;content&amp;quot;, html );&lt;br /&gt;
  this.myDlg.show(); &lt;br /&gt;
&lt;br /&gt;
  // Now that the dialog has been displayed, you can connect your method to some dialog elements&lt;br /&gt;
  // Example, a &amp;quot;close&amp;quot; button:&lt;br /&gt;
  dojo.connect( $(&#039;closeDlg&#039;), &#039;onclick&#039;, this, function(evt){&lt;br /&gt;
                evt.preventDefault();&lt;br /&gt;
                this.myDlg.hide();&lt;br /&gt;
            } );  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tip: be careful with &amp;quot;hide()&amp;quot; method to close your dialog: the dialog and its content is not completely removed from the DOM. It can cause you problems if you try to display the same dialog several times. A good practice is to wrap all the content of your dialog in a &amp;quot;&amp;lt;div id=&#039;myDlgContent&#039;&amp;gt;&amp;quot; div element, and to call &amp;quot;dojo.destroy(&#039;myDlgContent&#039;)&amp;quot; before displaying your dialog.&lt;br /&gt;
&lt;br /&gt;
=== Scoring dialogs ===&lt;br /&gt;
&lt;br /&gt;
Sometimes at the end of a round you want to display a big table that details the points wins in each section of the game.&lt;br /&gt;
&lt;br /&gt;
Example: in Hearts game, we display at the end of each round the number of &amp;quot;heart&amp;quot; cards collected by each player, the player who collected the Queen of Spades, and the total number of points loose by each player.&lt;br /&gt;
&lt;br /&gt;
Scoring dialogs are managed entirely on &#039;&#039;&#039;PHP side&#039;&#039;&#039;, but they are described here as their effects are visible only on client side.&lt;br /&gt;
&lt;br /&gt;
Displaying a scoring dialog is quite simple and is using a special notification type: &amp;quot;tableWindow&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  // on PHP side:&lt;br /&gt;
  $this-&amp;gt;notifyAllPlayers( &amp;quot;tableWindow&amp;quot;, &#039;&#039;, array(&lt;br /&gt;
            &amp;quot;id&amp;quot; =&amp;gt; &#039;finalScoring&#039;,&lt;br /&gt;
            &amp;quot;title&amp;quot; =&amp;gt; clienttranslate(&amp;quot;Title of the scoring dialog&amp;quot;),&lt;br /&gt;
            &amp;quot;table&amp;quot; =&amp;gt; $table&lt;br /&gt;
        ) ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;table&amp;quot; argument is a 2 dimensional PHP array that describe the table you want to display, line by line and column by column.&lt;br /&gt;
&lt;br /&gt;
Example: display an 3x3 array of strings&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   $table = array(&lt;br /&gt;
      array( &amp;quot;one&amp;quot;, &amp;quot;two&amp;quot;, &amp;quot;three&amp;quot; ),    // This is my first line&lt;br /&gt;
      array( &amp;quot;four&amp;quot;, &amp;quot;five&amp;quot;, &amp;quot;six&amp;quot; ),    // This is my second line&lt;br /&gt;
      array( &amp;quot;seven&amp;quot;, &amp;quot;height&amp;quot;, &amp;quot;nine&amp;quot; )    // This is my third line&lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see above, in each &amp;quot;cell&amp;quot; of your array you can display a simple string value. But you can also display a complex value with a template and associated arguments like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   $table = array(&lt;br /&gt;
      array( &amp;quot;one&amp;quot;, &amp;quot;two&amp;quot;, array( &amp;quot;str&amp;quot; =&amp;gt; &amp;quot;a string with an ${argument}&amp;quot;, &amp;quot;args&amp;quot; =&amp;gt; array( &#039;argument&#039; =&amp;gt; &#039;argument_value&#039; )  ) ),&lt;br /&gt;
      array( &amp;quot;four&amp;quot;, &amp;quot;five&amp;quot;, &amp;quot;six&amp;quot; ), &lt;br /&gt;
      array( &amp;quot;seven&amp;quot;, &amp;quot;height&amp;quot;, &amp;quot;nine&amp;quot; )&lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is especially useful when you want to display player names with colors. Example from &amp;quot;Hearts&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $firstRow = array( &#039;&#039; );&lt;br /&gt;
        foreach( $players as $player_id =&amp;gt; $player )&lt;br /&gt;
        {&lt;br /&gt;
            $firstRow[] = array( &#039;str&#039; =&amp;gt; &#039;${player_name}&#039;,&lt;br /&gt;
                                 &#039;args&#039; =&amp;gt; array( &#039;player_name&#039; =&amp;gt; $player[&#039;player_name&#039;] ),&lt;br /&gt;
                                 &#039;type&#039; =&amp;gt; &#039;header&#039;&lt;br /&gt;
                               );&lt;br /&gt;
        }&lt;br /&gt;
        $table[] = $firstRow;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use three extra attributes in the parameter array for the notification:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   $this-&amp;gt;notifyAllPlayers( &amp;quot;tableWindow&amp;quot;, &#039;&#039;, array(&lt;br /&gt;
            &amp;quot;id&amp;quot; =&amp;gt; &#039;finalScoring&#039;,&lt;br /&gt;
            &amp;quot;title&amp;quot; =&amp;gt; clienttranslate(&amp;quot;Title of the scoring dialog&amp;quot;),&lt;br /&gt;
            &amp;quot;table&amp;quot; =&amp;gt; $table,&lt;br /&gt;
            &amp;quot;header&amp;quot; =&amp;gt; &#039;&amp;lt;div&amp;gt;Some header&amp;lt;/div&amp;gt;&#039;,&lt;br /&gt;
            &amp;quot;footer&amp;quot; =&amp;gt; &#039;&amp;lt;div&amp;gt;Some footer&amp;lt;/div&amp;gt;&#039;,&lt;br /&gt;
            &amp;quot;closelabel&amp;quot; =&amp;gt; clienttranslate( &amp;quot;Closing button label&amp;quot; )&lt;br /&gt;
        ) ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;header&#039;&#039;&#039;: the content for this parameter will display before the table (also, the html will be parsed and player names will be colored according to the current game colors)&lt;br /&gt;
*&#039;&#039;&#039;footer&#039;&#039;&#039;: the content for this parameter will display after the table (no parsing for coloring the player names)&lt;br /&gt;
*&#039;&#039;&#039;closelabel&#039;&#039;&#039;: if this parameter is used, a button will be displayed with this label at the bottom of the popup and will allow players to close it (more easily than by clicking the top right &#039;cross&#039; icon). NB: this last parameter is not yet - 24/02/2014 - deployed on the studio, but can be used already and will take effect immediately with the next update.&lt;br /&gt;
&lt;br /&gt;
== Update players score ==&lt;br /&gt;
&lt;br /&gt;
Increase a player score (with a positive or negative number):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  this.scoreCtrl[ player_id ].incValue( score_delta );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set a player score to a specific value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  this.scoreCtrl[ player_id ].setValue( new_score );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Players panels ==&lt;br /&gt;
&lt;br /&gt;
=== Adding stuff to player&#039;s panel ===&lt;br /&gt;
&lt;br /&gt;
At first, create a new &amp;quot;JS template&amp;quot; string in your template (tpl) file:&lt;br /&gt;
&lt;br /&gt;
(from Reversi example)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var jstpl_player_board = &#039;\&amp;lt;div class=&amp;quot;cp_board&amp;quot;&amp;gt;\&lt;br /&gt;
    &amp;lt;div id=&amp;quot;stoneicon_p${id}&amp;quot; class=&amp;quot;gmk_stoneicon gmk_stoneicon_${color}&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;span id=&amp;quot;stonecount_p${id}&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;\&lt;br /&gt;
&amp;lt;/div&amp;gt;&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you add this piece of code in your JS file to add this template to each player panel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            // Setting up player boards&lt;br /&gt;
            for( var player_id in gamedatas.players )&lt;br /&gt;
            {&lt;br /&gt;
                var player = gamedatas.players[player_id];&lt;br /&gt;
                         &lt;br /&gt;
                // Setting up players boards if needed&lt;br /&gt;
                var player_board_div = $(&#039;player_board_&#039;+player_id);&lt;br /&gt;
                dojo.place( this.format_block(&#039;jstpl_player_board&#039;, player ), player_board_div );&lt;br /&gt;
            }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the code above is of course from your &amp;quot;setup&amp;quot; function in your Javascript).&lt;br /&gt;
&lt;br /&gt;
Very often, you have to distinguish current player and others players. In this case, you just have to create another JS template (ex: jstpl_otherplayer_board) and use it when &amp;quot;player_id&amp;quot; is different than &amp;quot;this.player_id&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Player&#039;s panel disabling/enabling ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.disablePlayerPanel( player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Disable given player panel (the panel background become gray).&lt;br /&gt;
&lt;br /&gt;
Usually, this is used to signal that this played passes, or will be inactive during a while.&lt;br /&gt;
&lt;br /&gt;
Note that the only effect of this is visual. There are no consequences on the behaviour of the panel itself.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.enablePlayerPanel( player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Enable a player panel that has been disabled before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.enableAllPlayerPanels()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Enable all player panels that has been disabled before.&lt;br /&gt;
&lt;br /&gt;
== Image loading ==&lt;br /&gt;
&lt;br /&gt;
See also [[Game_art:_img_directory]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be careful&#039;&#039;&#039;: by default, ALL images of your img directory are loaded on a player&#039;s browser when he loads the game. For this reason, don&#039;t let in your img directory images that are not useful, otherwise it&#039;s going to slowdown the game load.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dontPreloadImage( image_file_name )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using dontPreloadImage, you tell the interface to not preload a specific image in your img directory.&lt;br /&gt;
&lt;br /&gt;
Example of use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.dontPreloadImage( &#039;cards.png&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is particularly useful if for example you have 2 different themes for a game. To accelerate the loading of the game, you can specify to not preload images corresponding to the other theme.&lt;br /&gt;
&lt;br /&gt;
Another example of use: in &amp;quot;Gosu&amp;quot; game with Kamakor extension, you play with 5 sets of cards among 10 available. Cards images are organized by sets, and we only preload the images corresponding to the 5 current sets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You don&#039;t need to specify to not preload game box images (game_box.png, game_box75.png...) since they are not preloaded by default.&lt;br /&gt;
&lt;br /&gt;
== Other useful stuff ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.hitch&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With dojo.hitch, you can create a callback function that will run with your game object context whatever happen.&lt;br /&gt;
&lt;br /&gt;
Typical example: display a BGA confirmation dialog with a callback function created with dojo.hitch:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        this.confirmationDialog( _(&#039;Are you sure you want to make this?&#039;), dojo.hitch( this, function() {&lt;br /&gt;
            this.ajaxcall( &#039;/mygame/mygame/makeThis.html&#039;, { lock:true }, this, function( result ) {} );&lt;br /&gt;
        } ) );   &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example above, using dojo.hitch, we are sure that the &amp;quot;this&amp;quot; object will be set when the callback is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; updateCounters(counters)&lt;br /&gt;
: Useful for updating game counters in the player panel (such as resources). &lt;br /&gt;
: &#039;counters&#039; arg is an associative array [counter_name_value =&amp;gt; [ &#039;counter_name&#039; =&amp;gt; counter_name_value, &#039;counter_value&#039; =&amp;gt; counter_value_value], ... ]&lt;br /&gt;
: All counters must be referenced in this.gamedatas.counters and will be updated.&lt;br /&gt;
: DOM objects referenced by &#039;counter_name&#039; will have their innerHTML updated with &#039;counter_value&#039;.&lt;br /&gt;
&lt;br /&gt;
== BGA GUI components ==&lt;br /&gt;
&lt;br /&gt;
BGA framework provides some useful ready-to-use components for the game interface:&lt;br /&gt;
&lt;br /&gt;
[[Studio#BGA_Studio_game_components_reference]]&lt;br /&gt;
&lt;br /&gt;
Note that each time you are using an additional component, you must declare it at the top of your Javascript file in the list of modules used.&lt;br /&gt;
&lt;br /&gt;
Example if you are using &amp;quot;ebg.stock&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/stock&amp;quot;  /// &amp;lt;=== we are using ebg.stock module&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Faq&amp;diff=1078</id>
		<title>Faq</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Faq&amp;diff=1078"/>
		<updated>2014-02-22T19:51:24Z</updated>

		<summary type="html">&lt;p&gt;Een: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Help]]&lt;br /&gt;
&lt;br /&gt;
== General questions ==&lt;br /&gt;
&lt;br /&gt;
===What is Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
Board Game Arena (BGA) is an online board game platform. With BGA, you can play online and in real time against players from the whole world. A selection of various board games and card games is available. In order to play, the only thing you need is your browser!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What do you mean by &amp;quot;real time play&amp;quot;?===&lt;br /&gt;
&lt;br /&gt;
You can find many websites where you can play board games with a &amp;quot;turn based&amp;quot; approach: after each move, you have to wait for your opponents to connect to the website and play their own move. Most of the time, you have to wait a long time between each move, and games take a long time to finish (if they ever do).&lt;br /&gt;
&lt;br /&gt;
On Board Game Arena, your opponents are connected to the game platform all along the game, and they can see your moves and react to them immediately - as is the case in the real world.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What do I need to play?===&lt;br /&gt;
&lt;br /&gt;
Your browser ... and that&#039;s it!&lt;br /&gt;
&lt;br /&gt;
Board Game Arena does not require anything else on your computer. Thus, you can play from any computer, anywhere, anytime!&lt;br /&gt;
&lt;br /&gt;
In order to make this thing possible, we are using the very latest technologies available for the web. This is the reason you should play with the most up to date web browsers to enjoy an optimal BGA experience (read more about our [[Browser_support|browser policy]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How much does it cost to play on BGA?===&lt;br /&gt;
&lt;br /&gt;
Playing on BGA is free.&lt;br /&gt;
&lt;br /&gt;
You can also choose to help us by making a donation and becoming a [http://en.boardgamearena.com/#!club Board Game Arena club] member.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What are the games available on BGA?===&lt;br /&gt;
&lt;br /&gt;
Board Game Arena proposes a various selection of board and card games, but is specialized in modern (&amp;quot;European style&amp;quot;) adult games.&lt;br /&gt;
&lt;br /&gt;
[http://en.boardgamearena.com/#!gamelist See available games].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What can I do if I have an issue with the website?===&lt;br /&gt;
&lt;br /&gt;
Most of the issues one can encounter on this website should be solved with a simple web page refresh (or &amp;quot;F5&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you experience persistent issues, you can browse the [http://forum.boardgamearena.com/viewforum.php?f=4 bug section in the forum], see if someone already reported the issue, and add a new bug report if that&#039;s not the case. Please take some time to describe the bug you are reporting in detail so that we can quickly reproduce and fix it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is the legal status of this website?===&lt;br /&gt;
&lt;br /&gt;
All the games currently available on this site have been licensed or otherwise authorized by copyright holders. Please be aware that games available on BGA can be removed at the copyright holders demand (for example: if they publish their own adaptation of the game).&lt;br /&gt;
&lt;br /&gt;
Board Game Arena would like to thank all game publishers and game designers who allow us to have their games here, thus making it possible for this website to exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===I&#039;m a game publisher: why would I like to have my game on Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
The main goal of Board Game Arena is to make it easy for people to discover and love new games. We think that there is only two kinds of players on Board Game Arena: those who already bought the games they are playing online, and those who dream to buy them soon!&lt;br /&gt;
&lt;br /&gt;
As the activity of this website contributes to increasing a game&#039;s popularity and thus generates game boxes sales in the &amp;quot;real world&amp;quot;, we think it is beneficial to the boardgame community: people from all over the world can play online, we can have fun developing this game platform to the best of our ability, and game publishers get money from the box sales and build a special relationship with their players community.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Meeting players and starting games ==&lt;br /&gt;
&lt;br /&gt;
===I launched a new table but nobody is joining?===&lt;br /&gt;
&lt;br /&gt;
Although Board Game Arena has been enjoying a growing popularity, it is still a young website. For the most popular games, you can find players at any time of the day. For other games, we advise you to come back at peak hour (around 22:00 CEST) if you can&#039;t find opponents at the moment.&lt;br /&gt;
&lt;br /&gt;
Tip: check the number of online/available players for a game before launching the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===I joined a game. When does the game start?===&lt;br /&gt;
&lt;br /&gt;
Each table has an administrator, which is the table creator. It is the responsibility of the table administrator to start the game when he is satisfied with the number of players having joined the table.&lt;br /&gt;
&lt;br /&gt;
If you are the table administrator and can&#039;t launch the game, most of the time it&#039;s because there is not yet enough players joined the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is the meaning of the small color circle next to players names?===&lt;br /&gt;
&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/online_.png : this player is active. He completed an action very recently.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/inactive_.png : this player is inactive. He is connected to the website but did not perform any action recently.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/offline_.png : this player is offline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What does the &#039;% hits&#039; statistic mean?===&lt;br /&gt;
% hits = number of victory points / number of games played&lt;br /&gt;
&lt;br /&gt;
Where number of victory points is the following:&lt;br /&gt;
* When you win a 2 players game: 1 point.&lt;br /&gt;
* When you win a 3 players game: 1.5 points.&lt;br /&gt;
* When you win a 4 players game: 2 points.&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
This way, &amp;quot;50%&amp;quot; means that you win 50% of 2 players game, or 33% of 3 players game, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== During the game ==&lt;br /&gt;
&lt;br /&gt;
===What is the meaning of the icons next to players names?===&lt;br /&gt;
&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player.gif : this player must make a move now.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player_clockalert.gif : this player must make a move now, and he has spent his reflexion time. Can someone wake him up? ;)&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player_nonack.gif : this player must make a move now, but is probably not aware of the fact. If the situation does not evolve, it might be that this player has some connection issue.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/common/zombie.png : this player is a &amp;quot;zombie&amp;quot; (he left the game or has been fired from the game). The game goes on without this player.&lt;br /&gt;
&lt;br /&gt;
When the &amp;quot;normal&amp;quot; avatar of a player is displayed, it means that this player is waiting for his turn to play.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A player has to make a move but he/she doesn&#039;t. What can I do?===&lt;br /&gt;
&lt;br /&gt;
* First, please remember that this player has the right to think as long as he needs to about is next move...  well as long as he still has some time left on the game clock, that is.&lt;br /&gt;
* Then you can ask this player to confirm that he is still thinking about how to play.&lt;br /&gt;
* If this player seems to be away, we advise you to wait a few  minutes: this player may be experiencing some network problems or have left his computer temporarily.&lt;br /&gt;
* If the player is not coming back, you can expel him from the game as soon as he is running out of time on the game clock for the current move (red bar) or if he goes over his alloted time to think by more than 3/4/5 minutes (depending on game speed). See Clock section for details.  Important: in this case, no ELO points will be won by anybody for this game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is the current progression of the game I&#039;m playing?===&lt;br /&gt;
&lt;br /&gt;
A percentage of progression is displayed on the top of the web page.&lt;br /&gt;
There is also a progress bar at the bottom of the web page shows you the current progression of the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is forbidden on Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
* Leaving a game in progress on purpose.&lt;br /&gt;
* Taking an unnecessary and unreasonable amount of time at the end of game in an obvious losing situation.&lt;br /&gt;
* Kingmaking: enabling another player to win on purpose while there is a better move to make for yourself.&lt;br /&gt;
* Running out of time on the game clock.&lt;br /&gt;
* Giving some piece of information about the current game situation that corrupts the normal game flow.&lt;br /&gt;
* Communicating with another player about the game privately (ex: with MSN).&lt;br /&gt;
* Provocation / triumphalism / defeatism ... anything which is not fair play.&lt;br /&gt;
* Having a shocking avatar (no advertisement, no politics, ...)&lt;br /&gt;
&lt;br /&gt;
Going against these rules will affect your reputation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is absolutely forbidden in Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
* Creating multiple accounts and playing against oneself.&lt;br /&gt;
* Insulting other players in any manner.&lt;br /&gt;
&lt;br /&gt;
Going against these rules can lead to the removal of your account and/or to the blacklisting of your IP.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What if some player does something wrong?===&lt;br /&gt;
&lt;br /&gt;
The Board Game Arena platform has been designed to encourage players to maintain good behavior. The reputation system allows you to distinguish between good and bad players. Then, it is up to you to decide whether to start a game with them or not.&lt;br /&gt;
&lt;br /&gt;
If you think some player has had bad behavior during a game, you can give him a at the end of the game.&lt;br /&gt;
&lt;br /&gt;
If you think some player committed some serious wrongdoing during a game (ex: insult), please report this player to us (&amp;quot;report this player&amp;quot; link from his profile or game result page) so that we can take appropriate measures.&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Contact_us&amp;diff=1021</id>
		<title>Contact us</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Contact_us&amp;diff=1021"/>
		<updated>2013-12-18T21:14:23Z</updated>

		<summary type="html">&lt;p&gt;Een: Reverted edits by Januszk0 (talk) to last revision by Sourisdudesert&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Board Game Arena&#039;&#039;&#039; is located in France.&lt;br /&gt;
&lt;br /&gt;
== Contact e-mail ==&lt;br /&gt;
&lt;br /&gt;
contact(at)boardgamearena.com&lt;br /&gt;
&lt;br /&gt;
We receive &#039;&#039;&#039;a lot&#039;&#039;&#039; of e-mails. Please do not send us an e-mail in any of these two cases:&lt;br /&gt;
&lt;br /&gt;
* If you want to report a bug, please do it in the [http://boardgamearena.com/#!bugs bug reporting system]&lt;br /&gt;
* If you want to report a player for violation of BGA policy, use the &amp;quot;report this player&amp;quot; button on his/her profile.&lt;br /&gt;
&lt;br /&gt;
== Postal address ==&lt;br /&gt;
&lt;br /&gt;
G. Isabelli&lt;br /&gt;
&lt;br /&gt;
19 bd république&lt;br /&gt;
&lt;br /&gt;
92 260 Fontenay-aux-Roses&lt;br /&gt;
&lt;br /&gt;
FRANCE&lt;br /&gt;
&lt;br /&gt;
+33 6 17 25 80 34&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=BGA_Game_licences&amp;diff=973</id>
		<title>BGA Game licences</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=BGA_Game_licences&amp;diff=973"/>
		<updated>2013-10-01T20:56:18Z</updated>

		<summary type="html">&lt;p&gt;Een: moved BGA Game licences to BGA Game licenses: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[BGA Game licenses]]&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=BGA_Game_licenses&amp;diff=972</id>
		<title>BGA Game licenses</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=BGA_Game_licenses&amp;diff=972"/>
		<updated>2013-10-01T20:56:18Z</updated>

		<summary type="html">&lt;p&gt;Een: moved BGA Game licences to BGA Game licenses: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== What is a &amp;quot;license&amp;quot; exactly? ==&lt;br /&gt;
&lt;br /&gt;
Almost all games on the Board Game Arena platform are adaptations of existing commercial &amp;quot;real&amp;quot; board games. In order to host an adaptation of one of these board games on a website, the copyright owners must first grant a license/authorisation to this website.&lt;br /&gt;
&lt;br /&gt;
== Are all games on BGA licensed by their respective copyright owners? ==&lt;br /&gt;
&lt;br /&gt;
Yes, for all games that are not in the public domain, BGA has been granted an authorisation to create and host an online version.&lt;br /&gt;
&lt;br /&gt;
== Where can I find a list of games for which a license has already been granted? ==&lt;br /&gt;
&lt;br /&gt;
[http://en.studio.boardgamearena.com/#!page/availablelicences Check the list of available licenses]&lt;br /&gt;
&lt;br /&gt;
(NB: this page is restricted to developers registered in BGA studio. You&#039;ll need to enter your BGA studio credentials to access it)&lt;br /&gt;
&lt;br /&gt;
== What if I start developing a game that is not on the &amp;quot;Available licences&amp;quot; list? ==&lt;br /&gt;
&lt;br /&gt;
We allow developers to start any project in the Studio. But when you submit your project to go live on BGA, it will be rejected during the review process if BGA doesn&#039;t hold a proper license for the game.&lt;br /&gt;
&lt;br /&gt;
Exception: games in the public domain are of course not concerned.&lt;br /&gt;
&lt;br /&gt;
== Wow, I WANT to develop a game on this list! ==&lt;br /&gt;
&lt;br /&gt;
Great! :)&lt;br /&gt;
&lt;br /&gt;
But before creating a new project, please takes some seconds to check that someone is not already developing this game. If it is the case, maybe you can propose to join the project?&lt;br /&gt;
&lt;br /&gt;
[http://en.studio.boardgamearena.com/#!projects Check the list of current projects]&lt;br /&gt;
&lt;br /&gt;
== What needs to be done to add a game on this list? ==&lt;br /&gt;
&lt;br /&gt;
The copyright owners have to give an license/authorisation to BGA.&lt;br /&gt;
&lt;br /&gt;
Publishers do not have to pay anything to BGA for this, they just need to give their &amp;quot;go&amp;quot;. Most of the time, publishers want to have a formal agreement and we sign a contract with them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: you CAN&#039;T take the initiative to ask a license authorization on behalf of BGA, because the authorisation has to be granted to BGA (read more below).&lt;br /&gt;
&lt;br /&gt;
== Why aren&#039;t all the best-selling games that I love on that list? ==&lt;br /&gt;
&lt;br /&gt;
As you can imagine, the more popular a game is, the most difficult it can be to get an agreement to host this game on BGA.&lt;br /&gt;
&lt;br /&gt;
So if you are thinking about a very popular game that is not on this list, the reason is most likely &amp;quot;we asked but it was not possible&amp;quot; and not &amp;quot;we didn&#039;t think of it&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
We are really happy to have been able to build a very nice platform that managed to convince some of the most prestigious publishers to host their games here, but of course we can&#039;t convince -everyone-.&lt;br /&gt;
&lt;br /&gt;
== I want to make my prototype/unpublished game available on BGA ==&lt;br /&gt;
&lt;br /&gt;
This is possible, BUT most of the time, we consider this is a bad idea for the following reasons:&lt;br /&gt;
* if your game has not been published yet, there is certainly a good reason - most of the time there is still some more work to do on the game itself. Publishing a game on BGA that is not 100% finalized won&#039;t help you to finalize it.&lt;br /&gt;
* as a rule of thumb, popular board games on BGA are games that are popular in the real world. As a consequence prototypes most likely won&#039;t get a big audience on BGA.&lt;br /&gt;
* we also advise you against developing your own game: games adaptation are better when there is a designer whose focus is on the gameplay and a developer whose focus is on the implementation.&lt;br /&gt;
&lt;br /&gt;
So you definitely can develop your prototype/unpublished game on BGA, but we encourage you to think twice about it and do it only if you are in one/several of the situations below:&lt;br /&gt;
* the game is going to be published in the near future&lt;br /&gt;
* the game design process is really 100% done: the game is ready to be published in its current shape (ex: self-publishing game, game in a crowdfunding process...)&lt;br /&gt;
* you want to test your game with a big number of players to fine-tune some minor things (&amp;quot;balance&amp;quot; of the game).&lt;br /&gt;
&lt;br /&gt;
== What if I really want to develop a particular game that is NOT on the list below? ==&lt;br /&gt;
&lt;br /&gt;
This is the most frequently asked question, so for a detailed answer please follow the white rabbit down these numbered instructions:&lt;br /&gt;
&lt;br /&gt;
=== 0: ===&lt;br /&gt;
&lt;br /&gt;
In any case: please, do not contact publishers without asking us before. Just put yourself in the shoes of a game publisher who just published a popular game: what would you think if you received 40 emails from 40 developers speaking about some &amp;quot;BGA platform&amp;quot; and wanting to build an adaptation on it?&lt;br /&gt;
&lt;br /&gt;
Proceed to 1.&lt;br /&gt;
&lt;br /&gt;
=== 1: ===&lt;br /&gt;
&lt;br /&gt;
First, you should determine who is the owner of the digital rights of the game. Most of the time, this is the original publisher of the game. The original publisher is not always easy to find, because very often board games are translated and published in different countries by a local publisher.&lt;br /&gt;
&lt;br /&gt;
To find the original publisher:&lt;br /&gt;
* check in which country the game has been published first (ex: If it&#039;s in Poland, the original publisher is probably Polish).&lt;br /&gt;
* check the copyright notice at the end of the rules, where the original publisher is mentioned almost every time.&lt;br /&gt;
* very often, if two publishers are mentioned on a gamebox, the well-known publisher is the local publisher from your country and the other one is the original publisher.&lt;br /&gt;
&lt;br /&gt;
Special case: if the game is themed with a prestigious licence (Star Wars, Lord of the Rings, some TV show, some well known novel...), you can stop here immediately: contracts between game publishers and prestigious licenses owners are very restrictive, and there is 99% chance that an online adaptation on BGA would be impossible to manage.&lt;br /&gt;
&lt;br /&gt;
Continue to 2.&lt;br /&gt;
&lt;br /&gt;
=== 2: ===&lt;br /&gt;
&lt;br /&gt;
Read the list of publishers from the &amp;quot;available licenses&amp;quot; page to check if BGA is already working with this publisher.&lt;br /&gt;
&lt;br /&gt;
If YES, proceed to 3.&lt;br /&gt;
If NO, jump to 4.&lt;br /&gt;
&lt;br /&gt;
However, if the publisher is listed as &amp;quot;not working with BGA&amp;quot;, you can stop here immediately. It happens that some publishers are not convinced or interested by online boardgaming and it is their right to think so. The BGA team regularly meets new publishers during board games events to show them the platform, so we&#039;re working on this but -again- we cannot convince everyone.&lt;br /&gt;
&lt;br /&gt;
=== 3: ===&lt;br /&gt;
&lt;br /&gt;
Is there already in the list a game licensed by this publisher that is available to be developed or under development?&lt;br /&gt;
&lt;br /&gt;
If YES: as a rule of thumb, we do not ask more than one game to a publisher at a time. When we ask a license for a game, the publisher naturally expects that this game will be developed and published online. So we develop and publish a game before asking for another.&lt;br /&gt;
If you really want to develop another game from this particular publisher, the best option for you is to help develop the game that is currently licensed and then ask us to request the game you&#039;d like to develop.&lt;br /&gt;
&lt;br /&gt;
If NO: just ask us which game you want to develop and we will be happy to ask the publisher for his authorisation.&lt;br /&gt;
&lt;br /&gt;
=== 4: ===&lt;br /&gt;
&lt;br /&gt;
We have never worked with this publisher before.&lt;br /&gt;
&lt;br /&gt;
If you have already developed a game on BGA, we will be happy to contact the publisher to ask for an authorisation :)&lt;br /&gt;
&lt;br /&gt;
If this is your first game on BGA, we advise you to start with a game already on the list. Why? Because unfortunately, some developers ask us to request a license, and then don&#039;t finish the development. When we ask for a license, we are more comfortable if you have already shown your ability to realise an adaptation.&lt;br /&gt;
&lt;br /&gt;
Special case: if you know the publisher PERSONALLY, or have some contact there, please tell us so we can help you setup a contract allowing us to host a game adaptation on BGA.&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=BGA_Game_licenses&amp;diff=971</id>
		<title>BGA Game licenses</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=BGA_Game_licenses&amp;diff=971"/>
		<updated>2013-10-01T20:54:58Z</updated>

		<summary type="html">&lt;p&gt;Een: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== What is a &amp;quot;license&amp;quot; exactly? ==&lt;br /&gt;
&lt;br /&gt;
Almost all games on the Board Game Arena platform are adaptations of existing commercial &amp;quot;real&amp;quot; board games. In order to host an adaptation of one of these board games on a website, the copyright owners must first grant a license/authorisation to this website.&lt;br /&gt;
&lt;br /&gt;
== Are all games on BGA licensed by their respective copyright owners? ==&lt;br /&gt;
&lt;br /&gt;
Yes, for all games that are not in the public domain, BGA has been granted an authorisation to create and host an online version.&lt;br /&gt;
&lt;br /&gt;
== Where can I find a list of games for which a license has already been granted? ==&lt;br /&gt;
&lt;br /&gt;
[http://en.studio.boardgamearena.com/#!page/availablelicences Check the list of available licenses]&lt;br /&gt;
&lt;br /&gt;
(NB: this page is restricted to developers registered in BGA studio. You&#039;ll need to enter your BGA studio credentials to access it)&lt;br /&gt;
&lt;br /&gt;
== What if I start developing a game that is not on the &amp;quot;Available licences&amp;quot; list? ==&lt;br /&gt;
&lt;br /&gt;
We allow developers to start any project in the Studio. But when you submit your project to go live on BGA, it will be rejected during the review process if BGA doesn&#039;t hold a proper license for the game.&lt;br /&gt;
&lt;br /&gt;
Exception: games in the public domain are of course not concerned.&lt;br /&gt;
&lt;br /&gt;
== Wow, I WANT to develop a game on this list! ==&lt;br /&gt;
&lt;br /&gt;
Great! :)&lt;br /&gt;
&lt;br /&gt;
But before creating a new project, please takes some seconds to check that someone is not already developing this game. If it is the case, maybe you can propose to join the project?&lt;br /&gt;
&lt;br /&gt;
[http://en.studio.boardgamearena.com/#!projects Check the list of current projects]&lt;br /&gt;
&lt;br /&gt;
== What needs to be done to add a game on this list? ==&lt;br /&gt;
&lt;br /&gt;
The copyright owners have to give an license/authorisation to BGA.&lt;br /&gt;
&lt;br /&gt;
Publishers do not have to pay anything to BGA for this, they just need to give their &amp;quot;go&amp;quot;. Most of the time, publishers want to have a formal agreement and we sign a contract with them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: you CAN&#039;T take the initiative to ask a license authorization on behalf of BGA, because the authorisation has to be granted to BGA (read more below).&lt;br /&gt;
&lt;br /&gt;
== Why aren&#039;t all the best-selling games that I love on that list? ==&lt;br /&gt;
&lt;br /&gt;
As you can imagine, the more popular a game is, the most difficult it can be to get an agreement to host this game on BGA.&lt;br /&gt;
&lt;br /&gt;
So if you are thinking about a very popular game that is not on this list, the reason is most likely &amp;quot;we asked but it was not possible&amp;quot; and not &amp;quot;we didn&#039;t think of it&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
We are really happy to have been able to build a very nice platform that managed to convince some of the most prestigious publishers to host their games here, but of course we can&#039;t convince -everyone-.&lt;br /&gt;
&lt;br /&gt;
== I want to make my prototype/unpublished game available on BGA ==&lt;br /&gt;
&lt;br /&gt;
This is possible, BUT most of the time, we consider this is a bad idea for the following reasons:&lt;br /&gt;
* if your game has not been published yet, there is certainly a good reason - most of the time there is still some more work to do on the game itself. Publishing a game on BGA that is not 100% finalized won&#039;t help you to finalize it.&lt;br /&gt;
* as a rule of thumb, popular board games on BGA are games that are popular in the real world. As a consequence prototypes most likely won&#039;t get a big audience on BGA.&lt;br /&gt;
* we also advise you against developing your own game: games adaptation are better when there is a designer whose focus is on the gameplay and a developer whose focus is on the implementation.&lt;br /&gt;
&lt;br /&gt;
So you definitely can develop your prototype/unpublished game on BGA, but we encourage you to think twice about it and do it only if you are in one/several of the situations below:&lt;br /&gt;
* the game is going to be published in the near future&lt;br /&gt;
* the game design process is really 100% done: the game is ready to be published in its current shape (ex: self-publishing game, game in a crowdfunding process...)&lt;br /&gt;
* you want to test your game with a big number of players to fine-tune some minor things (&amp;quot;balance&amp;quot; of the game).&lt;br /&gt;
&lt;br /&gt;
== What if I really want to develop a particular game that is NOT on the list below? ==&lt;br /&gt;
&lt;br /&gt;
This is the most frequently asked question, so for a detailed answer please follow the white rabbit down these numbered instructions:&lt;br /&gt;
&lt;br /&gt;
=== 0: ===&lt;br /&gt;
&lt;br /&gt;
In any case: please, do not contact publishers without asking us before. Just put yourself in the shoes of a game publisher who just published a popular game: what would you think if you received 40 emails from 40 developers speaking about some &amp;quot;BGA platform&amp;quot; and wanting to build an adaptation on it?&lt;br /&gt;
&lt;br /&gt;
Proceed to 1.&lt;br /&gt;
&lt;br /&gt;
=== 1: ===&lt;br /&gt;
&lt;br /&gt;
First, you should determine who is the owner of the digital rights of the game. Most of the time, this is the original publisher of the game. The original publisher is not always easy to find, because very often board games are translated and published in different countries by a local publisher.&lt;br /&gt;
&lt;br /&gt;
To find the original publisher:&lt;br /&gt;
* check in which country the game has been published first (ex: If it&#039;s in Poland, the original publisher is probably Polish).&lt;br /&gt;
* check the copyright notice at the end of the rules, where the original publisher is mentioned almost every time.&lt;br /&gt;
* very often, if two publishers are mentioned on a gamebox, the well-known publisher is the local publisher from your country and the other one is the original publisher.&lt;br /&gt;
&lt;br /&gt;
Special case: if the game is themed with a prestigious licence (Star Wars, Lord of the Rings, some TV show, some well known novel...), you can stop here immediately: contracts between game publishers and prestigious licenses owners are very restrictive, and there is 99% chance that an online adaptation on BGA would be impossible to manage.&lt;br /&gt;
&lt;br /&gt;
Continue to 2.&lt;br /&gt;
&lt;br /&gt;
=== 2: ===&lt;br /&gt;
&lt;br /&gt;
Read the list of publishers from the &amp;quot;available licenses&amp;quot; page to check if BGA is already working with this publisher.&lt;br /&gt;
&lt;br /&gt;
If YES, proceed to 3.&lt;br /&gt;
If NO, jump to 4.&lt;br /&gt;
&lt;br /&gt;
However, if the publisher is listed as &amp;quot;not working with BGA&amp;quot;, you can stop here immediately. It happens that some publishers are not convinced or interested by online boardgaming and it is their right to think so. The BGA team regularly meets new publishers during board games events to show them the platform, so we&#039;re working on this but -again- we cannot convince everyone.&lt;br /&gt;
&lt;br /&gt;
=== 3: ===&lt;br /&gt;
&lt;br /&gt;
Is there already in the list a game licensed by this publisher that is available to be developed or under development?&lt;br /&gt;
&lt;br /&gt;
If YES: as a rule of thumb, we do not ask more than one game to a publisher at a time. When we ask a license for a game, the publisher naturally expects that this game will be developed and published online. So we develop and publish a game before asking for another.&lt;br /&gt;
If you really want to develop another game from this particular publisher, the best option for you is to help develop the game that is currently licensed and then ask us to request the game you&#039;d like to develop.&lt;br /&gt;
&lt;br /&gt;
If NO: just ask us which game you want to develop and we will be happy to ask the publisher for his authorisation.&lt;br /&gt;
&lt;br /&gt;
=== 4: ===&lt;br /&gt;
&lt;br /&gt;
We have never worked with this publisher before.&lt;br /&gt;
&lt;br /&gt;
If you have already developed a game on BGA, we will be happy to contact the publisher to ask for an authorisation :)&lt;br /&gt;
&lt;br /&gt;
If this is your first game on BGA, we advise you to start with a game already on the list. Why? Because unfortunately, some developers ask us to request a license, and then don&#039;t finish the development. When we ask for a license, we are more comfortable if you have already shown your ability to realise an adaptation.&lt;br /&gt;
&lt;br /&gt;
Special case: if you know the publisher PERSONALLY, or have some contact there, please tell us so we can help you setup a contract allowing us to host a game adaptation on BGA.&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=BGA_Game_licenses&amp;diff=970</id>
		<title>BGA Game licenses</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=BGA_Game_licenses&amp;diff=970"/>
		<updated>2013-10-01T20:52:40Z</updated>

		<summary type="html">&lt;p&gt;Een: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== What&#039;s a &amp;quot;license&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
Almost all games on the Board Game Arena platform are adaptations of existing commercial &amp;quot;real&amp;quot; board games. In order to host an adaptation of one of these board games on a website, the copyright owners must first grant a license/authorisation to this website.&lt;br /&gt;
&lt;br /&gt;
== Are all games on BGA licensed by their respective copyright owners? ==&lt;br /&gt;
&lt;br /&gt;
Yes, for all games that are not in the public domain, BGA has been granted an authorisation to create and host an online version.&lt;br /&gt;
&lt;br /&gt;
== Where can I find a list of games for which a license has already been granted? ==&lt;br /&gt;
&lt;br /&gt;
[http://en.studio.boardgamearena.com/#!page/availablelicences Check the list of available licenses]&lt;br /&gt;
&lt;br /&gt;
(NB: this page is restricted to developers registered in BGA studio. You&#039;ll need to enter your BGA studio credentials to access it)&lt;br /&gt;
&lt;br /&gt;
== What if I start developing a game that is not on the &amp;quot;Available licences&amp;quot; list? ==&lt;br /&gt;
&lt;br /&gt;
We allow developers to start any project in the Studio. But when you submit your project to go live on BGA, it will be rejected during the review process if BGA doesn&#039;t hold a proper license for the game.&lt;br /&gt;
&lt;br /&gt;
Exception: games in the public domain are of course not concerned.&lt;br /&gt;
&lt;br /&gt;
== Wow, I WANT to develop a game on this list! ==&lt;br /&gt;
&lt;br /&gt;
Great! :)&lt;br /&gt;
&lt;br /&gt;
But before creating a new project, please takes some seconds to check that someone is not already developing this game. If it is the case, maybe you can propose to join the project?&lt;br /&gt;
&lt;br /&gt;
[http://en.studio.boardgamearena.com/#!projects Check the list of current projects]&lt;br /&gt;
&lt;br /&gt;
== What needs to be done to add a game on this list? ==&lt;br /&gt;
&lt;br /&gt;
The copyright owners have to give an license/authorisation to BGA.&lt;br /&gt;
&lt;br /&gt;
Publishers do not have to pay anything to BGA for this, they just need to give their &amp;quot;go&amp;quot;. Most of the time, publishers want to have a formal agreement and we sign a contract with them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: you CAN&#039;T take the initiative to ask a license authorization on behalf of BGA, because the authorisation has to be granted to BGA (read more below).&lt;br /&gt;
&lt;br /&gt;
== Why aren&#039;t all the best-selling games that I love on that list? ==&lt;br /&gt;
&lt;br /&gt;
As you can imagine, the more popular a game is, the most difficult it can be to get an agreement to host this game on BGA.&lt;br /&gt;
&lt;br /&gt;
So if you are thinking about a very popular game that is not on this list, the reason is most likely &amp;quot;we asked but it was not possible&amp;quot; and not &amp;quot;we didn&#039;t think of it&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
We are really happy to have been able to build a very nice platform that managed to convince some of the most prestigious publishers to host their games here, but of course we can&#039;t convince -everyone-.&lt;br /&gt;
&lt;br /&gt;
== I want to make my prototype/unpublished game available on BGA ==&lt;br /&gt;
&lt;br /&gt;
This is possible, BUT most of the time, we consider this is a bad idea for the following reasons:&lt;br /&gt;
* if your game has not been published yet, there is certainly a good reason - most of the time there is still some more work to do on the game itself. Publishing a game on BGA that is not 100% finalized won&#039;t help you to finalize it.&lt;br /&gt;
* as a rule of thumb, popular board games on BGA are games that are popular in the real world. As a consequence prototypes most likely won&#039;t get a big audience on BGA.&lt;br /&gt;
* we also advise you against developing your own game: games adaptation are better when there is a designer whose focus is on the gameplay and a developer whose focus is on the implementation.&lt;br /&gt;
&lt;br /&gt;
So you definitely can develop your prototype/unpublished game on BGA, but we encourage you to think twice about it and do it only if you are in one/several of the situations below:&lt;br /&gt;
* the game is going to be published in the near future&lt;br /&gt;
* the game design process is really 100% done: the game is ready to be published in its current shape (ex: self-publishing game, game in a crowdfunding process...)&lt;br /&gt;
* you want to test your game with a big number of players to fine-tune some minor things (&amp;quot;balance&amp;quot; of the game).&lt;br /&gt;
&lt;br /&gt;
== What if I really want to develop a particular game that is NOT on the list below? ==&lt;br /&gt;
&lt;br /&gt;
This is the most frequently asked question, so for a detailed answer please follow the white rabbit down these numbered instructions:&lt;br /&gt;
&lt;br /&gt;
=== 0: ===&lt;br /&gt;
&lt;br /&gt;
In any case: please, do not contact publishers without asking us before. Just put yourself in the shoes of a game publisher who just published a popular game: what would you think if you received 40 emails from 40 developers speaking about some &amp;quot;BGA platform&amp;quot; and wanting to build an adaptation on it?&lt;br /&gt;
&lt;br /&gt;
Proceed to 1.&lt;br /&gt;
&lt;br /&gt;
=== 1: ===&lt;br /&gt;
&lt;br /&gt;
First, you should determine who is the owner of the digital rights of the game. Most of the time, this is the original publisher of the game. The original publisher is not always easy to find, because very often board games are translated and published in different countries by a local publisher.&lt;br /&gt;
&lt;br /&gt;
To find the original publisher:&lt;br /&gt;
* check in which country the game has been published first (ex: If it&#039;s in Poland, the original publisher is probably Polish).&lt;br /&gt;
* check the copyright notice at the end of the rules, where the original publisher is mentioned almost every time.&lt;br /&gt;
* very often, if two publishers are mentioned on a gamebox, the well-known publisher is the local publisher from your country and the other one is the original publisher.&lt;br /&gt;
&lt;br /&gt;
Special case: if the game is themed with a prestigious licence (Star Wars, Lord of the Rings, some TV show, some well known novel...), you can stop here immediately: contracts between game publishers and prestigious licenses owners are very restrictive, and there is 99% chance that an online adaptation on BGA would be impossible to manage.&lt;br /&gt;
&lt;br /&gt;
Continue to 2.&lt;br /&gt;
&lt;br /&gt;
=== 2: ===&lt;br /&gt;
&lt;br /&gt;
Read the list of publishers from the &amp;quot;available licenses&amp;quot; page to check if BGA is already working with this publisher.&lt;br /&gt;
&lt;br /&gt;
If YES, proceed to 3.&lt;br /&gt;
If NO, jump to 4.&lt;br /&gt;
&lt;br /&gt;
However, if the publisher is listed as &amp;quot;not working with BGA&amp;quot;, you can stop here immediately. It happens that some publishers are not convinced or interested by online boardgaming and it is their right to think so. The BGA team regularly meets new publishers during board games events to show them the platform, so we&#039;re working on this but -again- we cannot convince everyone.&lt;br /&gt;
&lt;br /&gt;
=== 3: ===&lt;br /&gt;
&lt;br /&gt;
Is there already in the list a game licensed by this publisher that is available to be developed or under development?&lt;br /&gt;
&lt;br /&gt;
If YES: as a rule of thumb, we do not ask more than one game to a publisher at a time. When we ask a license for a game, the publisher naturally expects that this game will be developed and published online. So we develop and publish a game before asking for another.&lt;br /&gt;
If you really want to develop another game from this particular publisher, the best option for you is to help develop the game that is currently licensed and then ask us to request the game you&#039;d like to develop.&lt;br /&gt;
&lt;br /&gt;
If NO: just ask us which game you want to develop and we will be happy to ask the publisher for his authorisation.&lt;br /&gt;
&lt;br /&gt;
=== 4: ===&lt;br /&gt;
&lt;br /&gt;
We have never worked with this publisher before.&lt;br /&gt;
&lt;br /&gt;
If you have already developed a game on BGA, we will be happy to contact the publisher to ask for an authorisation :)&lt;br /&gt;
&lt;br /&gt;
If this is your first game on BGA, we advise you to start with a game already on the list. Why? Because unfortunately, some developers ask us to request a license, and then don&#039;t finish the development. When we ask for a license, we are more comfortable if you have already shown your ability to realise an adaptation.&lt;br /&gt;
&lt;br /&gt;
Special case: if you know the publisher PERSONALLY, or have some contact there, please tell us so we can help you setup a contract allowing us to host a game adaptation on BGA.&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Browser_support&amp;diff=969</id>
		<title>Browser support</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Browser_support&amp;diff=969"/>
		<updated>2013-10-01T19:11:36Z</updated>

		<summary type="html">&lt;p&gt;Een: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;For the best experience, we recommend:&amp;lt;/h3&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Google Chrome 10+&#039;&#039;&#039; [http://www.google.com/chrome Windows] [http://www.google.com/chrome?platform=mac Mac] [http://www.google.com/chrome?platform=linux Linux]&lt;br /&gt;
* &#039;&#039;&#039;Mozilla Firefox 4+&#039;&#039;&#039; [http://www.mozilla.org/products/firefox/ Windows] [http://www.mozilla.org/products/firefox/ Mac] [http://www.mozilla.org/products/firefox/ Linux]&lt;br /&gt;
&lt;br /&gt;
Board Game Arena takes advantage of the most recent web technology to make it possible for you to play without installing anything on your computer: no software to download or update, no plugins to install, etc. &lt;br /&gt;
Consequently, to play you need to use a modern web browser. Generally speaking, the more recent your web browser is, the more pleasant your game experience on Board Game Arena will be. &lt;br /&gt;
&lt;br /&gt;
This website makes intensive use of Javascript and your browser&#039;s graphics capabilities. Thus, if you want to have the best gaming experience with Board Game Arena, you should use one of the browsers listed above. However, we officially support the following browsers:&lt;br /&gt;
&lt;br /&gt;
* Google Chrome 4+&lt;br /&gt;
* Mozilla Firefox 3.5+&lt;br /&gt;
* Internet Explorer 9+&lt;br /&gt;
* Safari 4+&lt;br /&gt;
&lt;br /&gt;
(Note: We do NOT support playing on iPads or similar tablets.)&lt;br /&gt;
&lt;br /&gt;
[[Category:Help]]&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Faq&amp;diff=968</id>
		<title>Faq</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Faq&amp;diff=968"/>
		<updated>2013-10-01T19:06:03Z</updated>

		<summary type="html">&lt;p&gt;Een: /* What do I need to play? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Help]]&lt;br /&gt;
&lt;br /&gt;
== General questions ==&lt;br /&gt;
&lt;br /&gt;
===What is Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
Board Game Arena (BGA) is an online board game platform. With BGA, you can play online and in real time against players from the whole world. A selection of various board games and card games is available. In order to play, the only thing you need is your browser!&lt;br /&gt;
&lt;br /&gt;
===What do you mean by &amp;quot;real time play&amp;quot;?===&lt;br /&gt;
&lt;br /&gt;
You can find many websites where you can play board games with a &amp;quot;turn based&amp;quot; approach: after each move, you have to wait for your opponents to connect to the website and play their own move. Most of the time, you have to wait a long time between each move, and games take a long time to finish (if they ever do).&lt;br /&gt;
&lt;br /&gt;
On Board Game Arena, your opponents are connected to the game platform all along the game, and they can see your moves and react to them immediately - as is the case in the real world.&lt;br /&gt;
&lt;br /&gt;
===What do I need to play?===&lt;br /&gt;
&lt;br /&gt;
Your browser ... and that&#039;s it!&lt;br /&gt;
&lt;br /&gt;
Board Game Arena does not require anything else on your computer. Thus, you can play from any computer, anywhere, anytime!&lt;br /&gt;
&lt;br /&gt;
In order to make this thing possible, we are using the very latest technologies available for the web. This is the reason you should play with the most up to date web browsers to enjoy an optimal BGA experience (read more about our [[Browser_support|browser policy]]).&lt;br /&gt;
&lt;br /&gt;
===How much does it cost to play on BGA?===&lt;br /&gt;
&lt;br /&gt;
Playing on BGA is free.&lt;br /&gt;
&lt;br /&gt;
You can also choose to help us by making a donation and becoming a [http://en.boardgamearena.com/#!club Board Game Arena club] member.&lt;br /&gt;
&lt;br /&gt;
===What are the games available on BGA?===&lt;br /&gt;
&lt;br /&gt;
Board Game Arena proposes a various selection of board and card games, but is specialized in modern (&amp;quot;European style&amp;quot;) adult games.&lt;br /&gt;
&lt;br /&gt;
[http://en.boardgamearena.com/#!gamelist See available games].&lt;br /&gt;
&lt;br /&gt;
===What can I do if I have an issue with the website?===&lt;br /&gt;
&lt;br /&gt;
Most of the issues one can encounter on this website should be solved with a simple web page refresh (or &amp;quot;F5&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you experience persistent issues, you can browse the [http://forum.boardgamearena.com/viewforum.php?f=4 bug section in the forum], see if someone already reported the issue, and add a new bug report if that&#039;s not the case. Please take some time to describe the bug you are reporting in detail so that we can quickly reproduce and fix it.&lt;br /&gt;
&lt;br /&gt;
===What is the legal status of this website?===&lt;br /&gt;
&lt;br /&gt;
All the games currently available on this site have been licensed or otherwise authorized by copyright holders. Please be aware that games available on BGA can be removed at the copyright holders demand (for example: if they publish their own adaptation of the game).&lt;br /&gt;
&lt;br /&gt;
Board Game Arena would like to thank all game publishers and game designers who allow us to have their games here, thus making it possible for this website to exist.&lt;br /&gt;
&lt;br /&gt;
===I&#039;m a game publisher: why would I like to have my game on Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
The main goal of Board Game Arena is to make it easy for people to discover and love new games. We think that there is only two kinds of players on Board Game Arena: those who already bought the games they are playing online, and those who dream to buy them soon!&lt;br /&gt;
&lt;br /&gt;
As the activity of this website contributes to increasing a game&#039;s popularity and thus generates game boxes sales in the &amp;quot;real world&amp;quot;, we think it is beneficial to the boardgame community: people from all over the world can play online, we can have fun developing this game platform to the best of our ability, and game publishers get money from the box sales and build a special relationship with their players community.&lt;br /&gt;
&lt;br /&gt;
== Meeting players and starting games ==&lt;br /&gt;
&lt;br /&gt;
===I launched a new table but nobody is joining?===&lt;br /&gt;
&lt;br /&gt;
Although Board Game Arena has been enjoying a growing popularity, it is still a young website. For the most popular games, you can find players at any time of the day. For other games, we advise you to come back at peak hour (around 22:00 CEST) if you can&#039;t find opponents at the moment.&lt;br /&gt;
&lt;br /&gt;
Tip: check the number of online/available players for a game before launching the table.&lt;br /&gt;
&lt;br /&gt;
===I joined a game. When does the game start?===&lt;br /&gt;
&lt;br /&gt;
Each table has an administrator, which is the table creator. It is the responsibility of the table administrator to start the game when he is satisfied with the number of players having joined the table.&lt;br /&gt;
&lt;br /&gt;
If you are the table administrator and can&#039;t launch the game, most of the time it&#039;s because there is not yet enough players joined the table.&lt;br /&gt;
&lt;br /&gt;
===What is the meaning of the small color circle next to players names?===&lt;br /&gt;
&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/online_.png : this player is active. He completed an action very recently.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/inactive_.png : this player is inactive. He is connected to the website but did not perform any action recently.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/offline_.png : this player is offline.&lt;br /&gt;
&lt;br /&gt;
===What does the &#039;% hits&#039; statistic mean?===&lt;br /&gt;
% hits = number of victory points / number of games played&lt;br /&gt;
&lt;br /&gt;
Where number of victory points is the following:&lt;br /&gt;
* When you win a 2 players game: 1 point.&lt;br /&gt;
* When you win a 3 players game: 1.5 points.&lt;br /&gt;
* When you win a 4 players game: 2 points.&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
This way, &amp;quot;50%&amp;quot; means that you win 50% of 2 players game, or 33% of 3 players game, etc.&lt;br /&gt;
&lt;br /&gt;
== During the game ==&lt;br /&gt;
&lt;br /&gt;
===What is the meaning of the icons next to players names?===&lt;br /&gt;
&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player.gif : this player must make a move now.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player_clockalert.gif : this player must make a move now, and he has spent his reflexion time. Can someone wake him up? ;)&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player_nonack.gif : this player must make a move now, but is probably not aware of the fact. If the situation does not evolve, it might be that this player has some connection issue.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/common/zombie.png : this player is a &amp;quot;zombie&amp;quot; (he left the game or has been fired from the game). The game goes on without this player.&lt;br /&gt;
&lt;br /&gt;
When the &amp;quot;normal&amp;quot; avatar of a player is displayed, it means that this player is waiting for his turn to play.&lt;br /&gt;
&lt;br /&gt;
===A player has to make a move but he/she doesn&#039;t. What can I do?===&lt;br /&gt;
&lt;br /&gt;
* First, please remember that this player has the right to think as long as he needs to about is next move...  well as long as he still has some time left on the game clock, that is.&lt;br /&gt;
* Then you can ask this player to confirm that he is still thinking about how to play.&lt;br /&gt;
* If this player seems to be away, we advise you to wait a few  minutes: this player may be experiencing some network problems or have left his computer temporarily.&lt;br /&gt;
* If the player is not coming back, you can expel him from the game as soon as he is running out of time on the game clock for the current move (red bar) or if he goes over his alloted time to think by more than 3/4/5 minutes (depending on game speed). See Clock section for details.  Important: in this case, no ELO points will be won by anybody for this game.&lt;br /&gt;
&lt;br /&gt;
===What is the current progression of the game I&#039;m playing?===&lt;br /&gt;
&lt;br /&gt;
A percentage of progression is displayed on the top of the web page.&lt;br /&gt;
There is also a progress bar at the bottom of the web page shows you the current progression of the game.&lt;br /&gt;
&lt;br /&gt;
===What is forbidden on Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
* Leaving a game in progress on purpose.&lt;br /&gt;
* Thinking an unnecessary and unreasonable amount of time at the end of game in an obvious losing situation.&lt;br /&gt;
* Kingmaking: enabling another player to win on purpose while there is a better move to make for yourself.&lt;br /&gt;
* Running out of time on the game clock.&lt;br /&gt;
* Giving some piece of information about the current game situation that corrupts the normal game flow.&lt;br /&gt;
* Communicating with another player about the game privately (ex: with MSN).&lt;br /&gt;
* Provocation / triumphalism / defeatism ... anything which is not fair play.&lt;br /&gt;
* Having a shocking avatar (no advertisement, no politics, ...)&lt;br /&gt;
&lt;br /&gt;
Going against these rules will affect your reputation.&lt;br /&gt;
&lt;br /&gt;
===What is absolutely forbidden in Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
* Creating multiple account and playing against oneself.&lt;br /&gt;
* Insulting other players in any manner.&lt;br /&gt;
&lt;br /&gt;
Going against these rules can lead to the removal of your account and/or to the blacklisting of your IP.&lt;br /&gt;
&lt;br /&gt;
===What if some player does something wrong?===&lt;br /&gt;
&lt;br /&gt;
Board Game Arena platform has been designed to encourage players to maintain a good behaviour. The reputation system allows you to distinguish between good and bad players. Then, it is up to you to decide whether to start a game with them or not.&lt;br /&gt;
&lt;br /&gt;
If you think some player has had a bad behavior during a game, you can give him a at the end of the game.&lt;br /&gt;
&lt;br /&gt;
If you think some player committed some serious wrongdoing during a game (ex: insult), please report this player to us (&amp;quot;report this player&amp;quot; link from his profile or game result page) so that we can take appropriate measures.&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Privacy&amp;diff=905</id>
		<title>Privacy</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Privacy&amp;diff=905"/>
		<updated>2013-07-09T06:22:06Z</updated>

		<summary type="html">&lt;p&gt;Een: Created page with &amp;quot;To create an account, you need to provide an email, user name and password. You can also complete your player profile with some other data.  We store this data. Yep. It would ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To create an account, you need to provide an email, user name and password.&lt;br /&gt;
You can also complete your player profile with some other data.&lt;br /&gt;
&lt;br /&gt;
We store this data. Yep. It would be pretty annoying for you to enter it each time you visit ;)&lt;br /&gt;
&lt;br /&gt;
If you are &#039;internet paranoid&#039; and you never provide any website with accurate personal information, congratulations! You can skip this section.&lt;br /&gt;
&lt;br /&gt;
If you are not, congratulations! You can also skip this section which is intended only for &#039;internet paranoid&#039; people anyway... It has been written for compliance with some social network authentication policy (take your bet, there is only two - oh, wait, if you are reading this you probably know). Well, to be fair, I could have left it empty too, the only check made by said social network being that the page exists. But, what would have been the fun in that?&lt;br /&gt;
&lt;br /&gt;
If you are still interested to read on some stuff instead of going straight to playing:&lt;br /&gt;
* Your password is stored encrypted, but the usual precautionary measures apply. You should use a strong password and not use the same one that for sensitive websites. Some people would say never to use the same password, but this looks like excessive blunt force to the head, except for websites with very sensitive information. Shouldn&#039;t be the case on a gaming website, but hey, do as you please.&lt;br /&gt;
* We don&#039;t share your email with third parties without your consent. Your consent may be implicit in some obvious cases (such as if you take part in a contest with prizes from a publisher, as it will be needed for the publisher to contact you to redeem the prize).&lt;br /&gt;
* Your profile information is visible to other players, as well as your gaming history on the website. So, since anyone can create an account on the site, it should be considered public information. But if you use a pseudonym for your username, it shouldn&#039;t be easy to link it to your real identity (in case you would be worried about that).&lt;br /&gt;
&lt;br /&gt;
Hope this all sounds reasonable to you, and that you can now enjoy Board Game Arena without second thoughts!&lt;br /&gt;
&lt;br /&gt;
Cheers and doughnuts,&lt;br /&gt;
&lt;br /&gt;
The admins.&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Game_interface_logic:_yourgamename.js&amp;diff=902</id>
		<title>Game interface logic: yourgamename.js</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Game_interface_logic:_yourgamename.js&amp;diff=902"/>
		<updated>2013-06-30T13:35:10Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Animations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the main file for your game interface. Here you will define:&lt;br /&gt;
&lt;br /&gt;
* which actions on the page will generate calls to the server&lt;br /&gt;
* what happens when you get a notification for change from the server and how it will show in the browser. &lt;br /&gt;
&lt;br /&gt;
== File structure ==&lt;br /&gt;
&lt;br /&gt;
The details on how the file is structured is described directly with comments on the code skeleton provided to you.&lt;br /&gt;
&lt;br /&gt;
Basically, here&#039;s this structure:&lt;br /&gt;
* constructor: here you can define variable global to your whole interface.&lt;br /&gt;
* setup: this method is called when the page is refreshed, in order you can setup the game interface.&lt;br /&gt;
* onEnteringState: the method is called when entering in a new game state. This way you can customize the view for this game state.&lt;br /&gt;
* onLeavingState: the method is called when leaving a game state.&lt;br /&gt;
* onUpdateActionButtons: called when entering in a new state, in order you can add action buttons in status bar.&lt;br /&gt;
* (utility methods): at this place you can define your utility methods&lt;br /&gt;
* (player&#039;s actions): at this place you can write your handlers for player&#039;s action on the interface (ex: click on an item).&lt;br /&gt;
* setupNotifications: in this method you associate notifications with notification handlers. This way, for each game notification, you trigger a javascript method to handle it and update the game interface.&lt;br /&gt;
* (notification handlers): at this place you can define your notifications handlers.&lt;br /&gt;
&lt;br /&gt;
== General tips ==&lt;br /&gt;
&lt;br /&gt;
; this.player_id&lt;br /&gt;
: Id of the player on whose browser the code is running.&lt;br /&gt;
&lt;br /&gt;
; this.isSpectator&lt;br /&gt;
: Flag set to true if the user at the table is a spectator (not a player).&lt;br /&gt;
: Note: if you want to hide some element for spectators, you&#039;d better use [[Game_interface_stylesheet:_yourgamename.css#spectatorMode|CSS &#039;spectatorMode&#039; class]].&lt;br /&gt;
&lt;br /&gt;
; this.gamedatas&lt;br /&gt;
: Contains your initial set of datas to init the game, created at game start or game refresh (F5)&lt;br /&gt;
: You can update it as needed to keep an up to date reference of the game on the client side if you need it (most of the time you don&#039;t).&lt;br /&gt;
&lt;br /&gt;
; isCurrentPlayerActive()&lt;br /&gt;
: Returns true if the player on whose browser the code is running is currently active (it&#039;s his turn to play)&lt;br /&gt;
&lt;br /&gt;
; this.getActivePlayerId()&lt;br /&gt;
: Return the ID of active player, or null if we are not in a &amp;quot;activeplayer&amp;quot; type state.&lt;br /&gt;
&lt;br /&gt;
; this.getActivePlayers()&lt;br /&gt;
: Return an array with the IDs of players that are currently active (or an empty array if there is not).&lt;br /&gt;
&lt;br /&gt;
== Dojo framework ==&lt;br /&gt;
&lt;br /&gt;
BGA is using the [http://dojotoolkit.org/ Dojo Javascript framework].&lt;br /&gt;
&lt;br /&gt;
The Dojo framework allows us to do complex things easier, and the BGA framework is using Dojo framework a lot.&lt;br /&gt;
&lt;br /&gt;
To realize game although, you only need to use a few part of the Dojo framework. All the Dojo methods you need to use are describe on this page.&lt;br /&gt;
&lt;br /&gt;
== Access and manipulate the DOM ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$(&#039;some_html_element_id&#039;)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The $() function is used to get some HTML element using its &amp;quot;id&amp;quot; attribute.&lt;br /&gt;
&lt;br /&gt;
Example 1: modify the content of a &amp;quot;span&amp;quot; element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
In your HTML code:&lt;br /&gt;
   &amp;lt;span id=&amp;quot;a_value_in_the_game_interface&amp;quot;&amp;gt;1234&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In your Javascript code:&lt;br /&gt;
   $(&#039;a_value_in_the_game_interface&#039;).innerHTML = &amp;quot;9999&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: $() is the standard method to access some HTML element with BGA Framework. You must not use &amp;quot;getElementById&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.style&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With dojo.style you can modify a CSS property of any HTML element of your interface.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // Make an element disappear&lt;br /&gt;
     dojo.style( &#039;my_element&#039;, &#039;display&#039;, &#039;none&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Give an element a 2px border&lt;br /&gt;
     dojo.style( &#039;my_element&#039;, &#039;borderWidth&#039;, &#039;2px&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Change the background position of an element&lt;br /&gt;
     // (very practical when you are using CSS sprite to transform an element to another)&lt;br /&gt;
     dojo.style( &#039;my_element&#039;, &#039;backgroundPosition&#039;, &#039;-20px -50px&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: you must always use dojo.style to modify CSS properties of HTML elements.&lt;br /&gt;
&lt;br /&gt;
Note²: if you have to modify several CSS properties of an element, or if you have some complex CSS transformation to do, you should consider using dojo.addClass/dojo.removeClass (see below).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo CSS classes manipulation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In many situation, a bunch of many small CSS property update can be replaced by a CSS class change (ie: you add a CSS class to your element instead of applying all modification manually).&lt;br /&gt;
&lt;br /&gt;
Advantages are:&lt;br /&gt;
* All your CSS stuff remains in your CSS file.&lt;br /&gt;
* You can add/remove a list of CSS modifications with a simple function and whithout error.&lt;br /&gt;
* You can test if you applied the stuff to an element with &amp;quot;dojo.hasClass&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Example from &amp;quot;Reversi&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // We add &amp;quot;possibleMove&amp;quot; to an element&lt;br /&gt;
    dojo.addClass( &#039;square_&#039;+x+&#039;_&#039;+y, &#039;possibleMove&#039; );&lt;br /&gt;
&lt;br /&gt;
    // In our CSS file, the class is defined as:&lt;br /&gt;
    .possibleMove {&lt;br /&gt;
      background-color: white;&lt;br /&gt;
      opacity: 0.2;&lt;br /&gt;
      filter:alpha(opacity=20); /* For IE8 and earlier */  &lt;br /&gt;
      cursor: pointer;  &lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     // So we&#039;ve applied 4 CSS property change in one line of code.&lt;br /&gt;
&lt;br /&gt;
     // ... and when we need to check if a square is a possible move on client side:&lt;br /&gt;
     if( dojo.hasClass( &#039;square_&#039;+x+&#039;_&#039;+y, &#039;possibleMove&#039; ) )&lt;br /&gt;
     { ... }&lt;br /&gt;
&lt;br /&gt;
     // ... and if we want to remove all possible moves in one line of code (see &amp;quot;dojo.query&amp;quot; method):&lt;br /&gt;
     dojo.query( &#039;.possibleMove&#039; ).removeClass( &#039;possibleMove&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conclusion: we encourage you to use dojo.addClass, dojo.removeClass and dojo.hasClass to make your life easier :)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.query&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With dojo.query, you can query a bunch of HTML elements with a single function, with a &amp;quot;CSS selector&amp;quot; style.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // All elements with class &amp;quot;possibleMove&amp;quot;:&lt;br /&gt;
     var elements = dojo.query( &#039;.possibleMove&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Count number of tokens (ie: elements with class &amp;quot;token&amp;quot;) on the board (ie: element with id &amp;quot;board&amp;quot;):&lt;br /&gt;
     dojo.query( &#039;#board .token&#039; ).length;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But what is really cool with dojo.query is that you can combine it with almost all methods above.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // Trigger a method when the mouse enter in any element with class &amp;quot;meeple&amp;quot;:&lt;br /&gt;
     dojo.query( &#039;.meeple&#039; ).connect( &#039;onmouseenter&#039;, this, &#039;myMethodToTrigger&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Hide all meeples who are on the board&lt;br /&gt;
     dojo.query( &#039;#board .meeple&#039; ).style( &#039;display&#039;, &#039;none&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.place&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
dojo.place is the best function to insert some HTML code somewhere in your game interface without breaking something. It is much better to use that &amp;quot;innerHTML=&#039;&#039;&amp;quot; method as soon as you must insert HTML tags and not only values.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // Insert your HTML code as a child of a container element&lt;br /&gt;
     dojo.place( &amp;quot;&amp;lt;your html code&amp;gt;&amp;quot;, &amp;quot;your_container_element_id&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
     // Replace the container element with your new html&lt;br /&gt;
     dojo.place( &amp;quot;&amp;lt;your html code&amp;gt;&amp;quot;, &amp;quot;your_container_element_id&amp;quot;, &amp;quot;replace&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the third parameter of dojo.place can take various interesting value: &amp;quot;first&amp;quot;, &amp;quot;after&amp;quot;, ... [http://dojotoolkit.org/reference-guide/1.7/dojo/place.html See full doc on dojo.place].&lt;br /&gt;
&lt;br /&gt;
Usually, when you want to insert some piece of HTML in your game interface, you should use &amp;quot;[[Game_layout:_view_and_template:_yourgamename.view.php_and_yourgamename_yourgamename.tpl#Javascript_templates|Javascript templates]]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addStyleToClass: function( cssClassName, cssProperty, propertyValue )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as dojo.style(), but for all the nodes set with the specified cssClassName&lt;br /&gt;
&lt;br /&gt;
=== Animations ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dojo Animations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
BGA animations is based on Dojo Animation ([http://dojotoolkit.org/documentation/tutorials/1.8/animation/ see tutorial here]).&lt;br /&gt;
&lt;br /&gt;
However, most of the time, you can just use methods below, which are built on top of Dojo Animation.&lt;br /&gt;
&lt;br /&gt;
Note: one interesting method from Dojo that could be useful from time to time is &amp;quot;Dojo.Animation&amp;quot;. It allows you to make any CSS property &amp;quot;slide&amp;quot; from one value to another.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideToObject( mobile_obj, target_obj, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use slideToObject to &amp;quot;slide&amp;quot; an element to a target position.&lt;br /&gt;
&lt;br /&gt;
Sliding element on the game area is the recommended and the most used way to animate your game interface. Using slides allow players to figure out what is happening on the game, as if they were playing with the real boardgame.&lt;br /&gt;
&lt;br /&gt;
The parameters are:&lt;br /&gt;
* mobile_obj: the ID of the object to move. This object must be &amp;quot;relative&amp;quot; or &amp;quot;absolute&amp;quot; positioned.&lt;br /&gt;
* target_obj: the ID of the target object. This object must be &amp;quot;relative&amp;quot; or &amp;quot;absolute&amp;quot; positioned. Note that it is not mandatory that mobile_obj and target_obj have the same size. If their size are different, the system slides the center of mobile_obj to the center of target_obj.&lt;br /&gt;
* duration: (optional) defines the duration in millisecond of the slide. The default is 500 milliseconds.&lt;br /&gt;
* delay: (optional). If you defines a delay, the slide will start only after this delay. This is particularly useful when you want to slide several object from the same position to the same position: you can give a 0ms delay to the first object, a 100ms delay to the second one, a 200ms delay to the third one, ... this way they won&#039;t be superposed during the slide.&lt;br /&gt;
&lt;br /&gt;
BE CAREFUL: The method returns an dojo.fx animation, so you can combine it with other animation if you want to. It means that you have to call the &amp;quot;play()&amp;quot; method, otherwise the animation WON&#039;T START.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.slideToObject( &amp;quot;some_token&amp;quot;, &amp;quot;some_place_on_board&amp;quot; ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideToObjectPos( mobile_obj, target_obj, target_x, target_y, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method does exactly the same than &amp;quot;slideToObjectPos&amp;quot;, except than you can specify some (x,y) coordinates. This way, &amp;quot;mobile_obj&amp;quot; will slide to the specified x,y position relatively to &amp;quot;target_obj&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example: slide a token to some place on the board, 10 pixels to the bottom:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.slideToObjectPos( &amp;quot;some_token&amp;quot;, &amp;quot;some_place_on_board&amp;quot;, 0, 10 ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideTemporaryObject( mobile_obj_html, mobile_obj_parent, from, to, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is useful when you want to slide a temporary HTML object from one place to another. As this object does not exists before the animation and won&#039;t remain after, it could be complex to create this object (with dojo.place), to place it at its origin (with placeOnObject) to slide it (with slideToObject) and to make it disappear at the end.&lt;br /&gt;
&lt;br /&gt;
slideTemporaryObject does all of this for you:&lt;br /&gt;
* mobile_obj_html is a piece of HTML code that represent the object to slide.&lt;br /&gt;
* mobile_obj_parent is the ID of an HTML element of your interface that will be the parent of this temporary HTML object.&lt;br /&gt;
* from is the ID of the origin of the slide.&lt;br /&gt;
* to is the ID of the target of the slide.&lt;br /&gt;
* duration/delay works exactly like in &amp;quot;slideToObject&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.slideTemporaryObject( &#039;&amp;lt;div class=&amp;quot;token_icon&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&#039;, &#039;tokens&#039;, &#039;my_origin_div&#039;, &#039;my_target_div&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideToObjectAndDestroy: function( node, to, time, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is a handy shortcut to slide an existing HTML object to some place then destroy it upon arrival. It can be used for example to move a victory token or a card from the board to the player panel to show that the player earns it, then destroy it when we don&#039;t need to keep it visible on the player panel.&lt;br /&gt;
&lt;br /&gt;
It works the same as this.slideToObject and takes the same arguments. &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.slideToObjectAndDestroy( &amp;quot;some_token&amp;quot;, &amp;quot;some_place_on_board&amp;quot;, 1000, 0 ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.fadeOutAndDestroy( node )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function fade out the target HTML node, then destroy it.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.fadeOutAndDestroy( &amp;quot;a_card_that_must_disappear&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CAREFUL: the HTML node still exists until during few milliseconds, until the fadeOut has been completed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rotating elements&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can check here [http://jimfulton.info/demos/dojo-animated-rotate.html an example of use] of Dojo to make an element rotate.&lt;br /&gt;
&lt;br /&gt;
This example combines &amp;quot;Dojo.Animation&amp;quot; method and a CSS3 property that allow you to rotate the element.&lt;br /&gt;
&lt;br /&gt;
IMPORTANT: to asses browser compatibility, you must select the CSS property to use just like in the example (see sourcecode below):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        var transform;&lt;br /&gt;
        dojo.forEach(&lt;br /&gt;
            [&#039;transform&#039;, &#039;WebkitTransform&#039;, &#039;msTransform&#039;,&lt;br /&gt;
             &#039;MozTransform&#039;, &#039;OTransform&#039;],&lt;br /&gt;
            function (name) {&lt;br /&gt;
                if (typeof dojo.body().style[name] != &#039;undefined&#039;) {&lt;br /&gt;
                    transform = name;&lt;br /&gt;
                }&lt;br /&gt;
            });&lt;br /&gt;
        // ... and then use &amp;quot;transform&amp;quot; as the name of your CSS property for rotation&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Moving elements ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.placeOnObject( mobile_obj, target_obj )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
placeOnObject works exactly like &amp;quot;slideToObject&amp;quot;, except that the effect is immediate.&lt;br /&gt;
&lt;br /&gt;
This is not really an animation, but placeOnObject is frequently used before starting an animation.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  // (We just created an object &amp;quot;my_new_token&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  // Place the new token on current player board&lt;br /&gt;
  this.placeOnObject( &amp;quot;my_new_token&amp;quot;, &amp;quot;overall_player_board_&amp;quot;+this.player_id );&lt;br /&gt;
  &lt;br /&gt;
  // Then slide it to its position on the board&lt;br /&gt;
  this.slideToObject( &amp;quot;my_new_token&amp;quot;, &amp;quot;a_place_on_board&amp;quot; ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.placeOnObjectPos( mobile_obj, target_obj, target_x, target_y )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method works exactly like placeOnObject, except than you can specify some (x,y) coordinates. This way, &amp;quot;mobile_obj&amp;quot; will be placed to the specified x,y position relatively to &amp;quot;target_obj&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.attachToNewParent( mobile_obj, target_obj )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With this method, you change the HTML parent of &amp;quot;mobile_obj&amp;quot; element. &amp;quot;target_obj&amp;quot; is the new parent of this element. The beauty of &lt;br /&gt;
attachToNewParent is that the mobile_obj element DOES NOT MOVE during this process.&lt;br /&gt;
&lt;br /&gt;
Note: what happens is that the method calculate a relative position of mobile_obj to make sure it does not move after the HTML parent changes.&lt;br /&gt;
&lt;br /&gt;
Why using this method?&lt;br /&gt;
&lt;br /&gt;
Changing the HTML parent of an element can be useful for the following reasons:&lt;br /&gt;
* When the HTML parent moves, all its child are moving with them. If some game elements is no more linked with a parent HTML object, you may want to attach it to another place.&lt;br /&gt;
* The z_order (vertical order of display) depends on the position in the DOM, so you may need to change the parent of some game elements when they are moving in your game area.&lt;br /&gt;
&lt;br /&gt;
CAREFUL: when you attach an HTML element with a new parent, you break all references to this HTML element (ex: dojo.connect).&lt;br /&gt;
&lt;br /&gt;
== Players input ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.connect&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Used to associate a player event with one of your notification method.&lt;br /&gt;
&lt;br /&gt;
Example: associate a click on an element (&amp;quot;my_element&amp;quot;) with one of our method (&amp;quot;onClickOnMyElement&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      dojo.connect( $(&#039;my_element&#039;), &#039;onClick&#039;, this, &#039;onClickOnMyElement&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: this is the only possible correct way to associate a player input event to your code, and you must not use anything else.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.checkAction( &amp;quot;my_action_name&amp;quot; )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Usage: checkAction: function( action, nomessage )&lt;br /&gt;
&lt;br /&gt;
Check if player can do the specified action by taking into account:&lt;br /&gt;
* current game state&lt;br /&gt;
* interface locking (a player can&#039;t do any action if an action is already in progress)&lt;br /&gt;
&lt;br /&gt;
return true if action is authorized (ie: the action is listed as a &amp;quot;possibleaction&amp;quot; in current game state).&lt;br /&gt;
&lt;br /&gt;
return false and display an error message if not (display no message if nomessage parameter is true). The displayed error message could be either &amp;quot;This move is not allowed at this moment&amp;quot; or &amp;quot;An action is already in progress&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  function onClickOnGameElement( evt )&lt;br /&gt;
  {&lt;br /&gt;
     if( this.checkAction( &amp;quot;my_action&amp;quot; ) )&lt;br /&gt;
     {&lt;br /&gt;
        // Do the action&lt;br /&gt;
     }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.ajaxcall( url, parameters, obj_callback, callback, callback_error )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method must be used to send a player input to the game server.&lt;br /&gt;
&lt;br /&gt;
* url: the url of the action to perform. For a game, it must be: &amp;quot;/&amp;lt;mygame&amp;gt;/&amp;lt;mygame&amp;gt;/myAction.html&amp;quot;&lt;br /&gt;
* parameters: an array of parameter to send to the game server. Note that &amp;quot;lock:true&amp;quot; must always be specified in this list of parameter in order the interface can be locked during the server call.&lt;br /&gt;
* obj_callback: must be set to &amp;quot;this&amp;quot;.&lt;br /&gt;
* callback: a function to trigger when the server returns and everything went fine.&lt;br /&gt;
* callback_error: (optional and rarely used) a function to trigger when the server returns an error.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.ajaxcall( &#039;/mygame/mygame/myaction.html&#039;, { lock: true, &lt;br /&gt;
   arg1: myarg1, &lt;br /&gt;
   arg2: myarg2, &lt;br /&gt;
   ...&lt;br /&gt;
}, this, function( result ) {&lt;br /&gt;
   // Do some stuff after a successful call&lt;br /&gt;
} );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restricted arguments names (please don&#039;t use them):&lt;br /&gt;
* &amp;quot;action&amp;quot;&lt;br /&gt;
* &amp;quot;module&amp;quot;&lt;br /&gt;
* &amp;quot;class&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.confirmationDialog()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Display a confirmation dialog with a yes/no choice.&lt;br /&gt;
&lt;br /&gt;
We advice you to NOT use this function unless the player action is really critical and could ruins the game, because it slows down the game and upset players.&lt;br /&gt;
&lt;br /&gt;
Usage: this.confirmationDialog( &amp;quot;Question to displayed&amp;quot;, callback_function_if_click_on_yes );&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.confirmationDialog( _(&#039;Are you sure to use this bonus (points penalty at the end of the game) ?&#039;),&lt;br /&gt;
                         dojo.hitch( this, function() {&lt;br /&gt;
                           this.ajaxcall( &#039;/seasons/seasons/useBonus.html&#039;,&lt;br /&gt;
                                { id:bonus_id, lock:true }, this, function( result ) {} );&lt;br /&gt;
                        } ) ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; addEventToClass: function( cssClassName, eventName, functionName )&lt;br /&gt;
: Same as dojo.connect(), but for all the nodes set with the specified cssClassName&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addActionButton( id, label, method, (opt)depreciated, (opt)bHighlight )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use this method to add an action button in the main action status bar.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* id: a ID that should be unique in your HTML DOM document.&lt;br /&gt;
* label: the text of the button. Should be translatable (use _() function).&lt;br /&gt;
* method: the name of your method that must be triggered when the player clicks on this button.&lt;br /&gt;
* depreciated (optional): do not use this. Please not specify this argument or use &amp;quot;null&amp;quot;.&lt;br /&gt;
* bHighlight: if set to &amp;quot;true&amp;quot;, the button is going blink to catch player&#039;s attention. Please don&#039;t abuse of blinking button.&lt;br /&gt;
&lt;br /&gt;
You should only use this method in your &amp;quot;onUpdateActionButtons&amp;quot; method. Usually, you use it like this (from Hears example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        onUpdateActionButtons: function( stateName, args )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &#039;onUpdateActionButtons: &#039;+stateName );&lt;br /&gt;
                      &lt;br /&gt;
            if( this.isCurrentPlayerActive() )&lt;br /&gt;
            {            &lt;br /&gt;
                switch( stateName )&lt;br /&gt;
                {&lt;br /&gt;
                case &#039;giveCards&#039;:&lt;br /&gt;
                    this.addActionButton( &#039;giveCards_button&#039;, _(&#039;Give selected cards&#039;), &#039;onGiveCards&#039; ); &lt;br /&gt;
                    break;&lt;br /&gt;
&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        },   &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example above, we are adding a &amp;quot;Give selected cards&amp;quot; button in the case we are on game state &amp;quot;giveCards&amp;quot;. When player clicks on this button, it triggers our &amp;quot;onGiveCards&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
See [[Translations]]&lt;br /&gt;
&lt;br /&gt;
== Notifications ==&lt;br /&gt;
&lt;br /&gt;
When something happens on the server side, your game interface Javascript logic received a notification.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how you can handle these notifications on the client side.&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to notifications ===&lt;br /&gt;
&lt;br /&gt;
Your Javascript &amp;quot;setupNotifications&amp;quot; method is the place where you can subscribe to notifications from your PHP code.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how you associate one of your Javascript method to a notification &amp;quot;playDisc&amp;quot; (from Reversi example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   // In setupNotifications method:&lt;br /&gt;
   dojo.subscribe( &#039;playDisc&#039;, this, &amp;quot;notif_playDisc&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the &amp;quot;playDisc&amp;quot; corresponds to the name of the notification you define it in your PHP code, in your &amp;quot;notifyAllPlayers&amp;quot; or &amp;quot;notifyPlayer&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Then, you have to define your &amp;quot;notif_playDisc&amp;quot; method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        notif_playDisc: function( notif )&lt;br /&gt;
        {&lt;br /&gt;
            // Remove current possible moves (makes the board more clear)&lt;br /&gt;
            dojo.query( &#039;.possibleMove&#039; ).removeClass( &#039;possibleMove&#039; );        &lt;br /&gt;
        &lt;br /&gt;
            this.addDiscOnBoard( notif.args.x, notif.args.y, notif.args.player_id );&lt;br /&gt;
        },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a notification handler like our &amp;quot;notif_playDisc&amp;quot; method, you can access to all notifications arguments with &amp;quot;notif.args&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // If you did this on PHP side:&lt;br /&gt;
    self::notifyAllPlayers( &amp;quot;myNotification&amp;quot;, &#039;&#039;, array( &amp;quot;myArgument&amp;quot; =&amp;gt; 3 ) );&lt;br /&gt;
&lt;br /&gt;
    // On Javascript side, you can access the &amp;quot;myArgument&amp;quot; like this:&lt;br /&gt;
    notif_myNotification: function( notif )&lt;br /&gt;
    {&lt;br /&gt;
       alert( &amp;quot;myArgument = &amp;quot; + notif.args.myArgument );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Synchronous notifications ===&lt;br /&gt;
&lt;br /&gt;
When several notifications are received by your game interface, these notifications are processed immediately, one after the other, in the same exact order they have been generated in your PHP game logic.&lt;br /&gt;
&lt;br /&gt;
However, sometimes, you need to give some time to the players to figure out what happened on the game before jumping to the next notification. Indeed, in many games, they are a lot of automatic actions, and the computer is going to resolve all these actions very fast if you don&#039;t tell it not to do so.&lt;br /&gt;
&lt;br /&gt;
As an example, for Reversi, when someone is playing a disc, we want to wait 500 milliseconds before doing anything else in order the opponent player can figure out what move has been played.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how we do this, right after our subscription:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       dojo.subscribe( &#039;playDisc&#039;, this, &amp;quot;notif_playDisc&amp;quot; );&lt;br /&gt;
       this.notifqueue.setSynchronous( &#039;playDisc&#039;, 500 );   // Wait 500 milliseconds after executing the playDisc handler&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tooltips ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltip( nodeId, _( helpString ), _( actionString ), delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add a simple text tooltip to the DOM node.&lt;br /&gt;
&lt;br /&gt;
Specify &#039;helpString&#039; to display some information about &amp;quot;what is this game element?&amp;quot;.&lt;br /&gt;
Specify &#039;actionString&#039; to display some information about &amp;quot;what happens when I click on this element?&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You must specify both helpString and actionString. Most of the time, you use only one and specify a void string (&amp;quot;&amp;quot;) for the other one.&lt;br /&gt;
&lt;br /&gt;
Usually, _() must be used for the text to be marked for translation.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Delay&amp;quot; is an optional parameter. Usually, it is primarily used to specify a zero delay for some game element when the tooltip gives really important information for the game - but remember: no essential information must be placed in tooltips as they won&#039;t be displayed in some browser (see Guidelines).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.addTooltip( &#039;cardcount&#039;, _(&#039;Number of cards in hand&#039;), &#039;&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltipHtml( nodeId, html, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add an HTML tooltip to the DOM node (for more elaborate content such as presenting a bigger version of a card).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltipToClass( cssClass, _( helpString ), _( actionString ), delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add a simple text tooltip to all the DOM nodes set with this cssClass. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT: all concerned nodes must have IDs to get tooltips.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addTooltipHtmlToClass( cssClass, html, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add an HTML tooltip to to all the DOM nodes set with this cssClass (for more elaborate content such as presenting a bigger version of a card).&lt;br /&gt;
&lt;br /&gt;
IMPORTANT: all concerned nodes must have IDs to get tooltips&lt;br /&gt;
&lt;br /&gt;
== Dialogs, warning messages, confirmation dialogs, ... ==&lt;br /&gt;
&lt;br /&gt;
=== Warning messages ===&lt;br /&gt;
&lt;br /&gt;
Sometimes, there is something important that is happening on the game and you have to make sure all players get the message. Most of the time, the evolution of the game situation or the game log is enough, but sometimes you need something more visible.&lt;br /&gt;
&lt;br /&gt;
Ex: someone fulfill one of the end of the game condition, so this is the last turn.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.showMessage( msg, type )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
showMessage shows a message in a big rectangular area on the top of the screen of current player.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;msg&amp;quot; is the string to display. It should be translated.&lt;br /&gt;
* &amp;quot;type&amp;quot; can be set to &amp;quot;info&amp;quot; or &amp;quot;error&amp;quot;. If set to &amp;quot;info&amp;quot;, the message will be an informative message on a white background. If set to &amp;quot;error&amp;quot;, the message will be an error message on a red background.&lt;br /&gt;
&lt;br /&gt;
Important: the normal way to inform players about the progression of the game is the game log. &amp;quot;showMessage&amp;quot; is intrusive and should not be used often.&lt;br /&gt;
&lt;br /&gt;
=== Confirmation dialog ===&lt;br /&gt;
&lt;br /&gt;
When an important action with a lot of consequences is triggered by the player, you may want to propose a confirmation dialog.&lt;br /&gt;
&lt;br /&gt;
CAREFUL: the general guidelines of BGA is to AVOID the use of confirmation dialog. Confirmation dialogs slow down the game and bother players. The players knows that they have to pay attention about each move when they are playing online.&lt;br /&gt;
&lt;br /&gt;
The situation where you should use a confirmation dialog are the following:&lt;br /&gt;
* It must not happen very often during a game.&lt;br /&gt;
* It must be linked to an action that can really &amp;quot;kill a game&amp;quot; if the player do not pay attention.&lt;br /&gt;
* It must be something that can be done by mistake (ex: a link on the action status bar).&lt;br /&gt;
&lt;br /&gt;
How to display a confirmation dialog:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        this.confirmationDialog( _(&#039;Are you sure you want to make this?&#039;), dojo.hitch( this, function() {&lt;br /&gt;
            this.ajaxcall( &#039;/mygame/mygame/makeThis.html&#039;, { lock:true }, this, function( result ) {} );&lt;br /&gt;
        } ) );   &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dialogs ===&lt;br /&gt;
&lt;br /&gt;
At first, you shouldn&#039;t use dialogs windows.&lt;br /&gt;
&lt;br /&gt;
BGA guidelines specify that all game elements should be displayed on the main screen. Players can eventually scroll down to see game elements they don&#039;t need to see anytime, and you may eventually create anchors to move between game area section. Of course dialogs windows are very practical, but the thing is: all players know how to scroll down, and not all players know how to show up your dialog window. In addition, when the dialog shows up, players can&#039;t access the other game components.&lt;br /&gt;
&lt;br /&gt;
Sometimes although, you need to display a dialog window. Here is how you do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  // Create the new dialog. You should store the handler in a member variable to access it later&lt;br /&gt;
  this.myDlg = new dijit.Dialog({ title: _(&amp;quot;my dialog title to translate&amp;quot;) });&lt;br /&gt;
&lt;br /&gt;
  // Create the HTML of my dialog. The best practice here is to use [[Game_layout:_view_and_template:_yourgamename.view.php_and_yourgamename_yourgamename.tpl#Javascript_templates|Javascript templates]]:&lt;br /&gt;
  var html = this.format_block( &#039;jstpl_myDialogTemplate&#039;, { &lt;br /&gt;
                arg1: myArg1,&lt;br /&gt;
                arg2: myArg2,&lt;br /&gt;
                ...&lt;br /&gt;
            } );  &lt;br /&gt;
&lt;br /&gt;
  // Show the dialog&lt;br /&gt;
  this.myDlg.attr(&amp;quot;content&amp;quot;, html );&lt;br /&gt;
  this.myDlg.show(); &lt;br /&gt;
&lt;br /&gt;
  // Now that the dialog has been displayed, you can connect your method to some dialog elements&lt;br /&gt;
  // Example, a &amp;quot;close&amp;quot; button:&lt;br /&gt;
  dojo.connect( $(&#039;closeDlg&#039;), &#039;onclick&#039;, this, function(evt){&lt;br /&gt;
                evt.preventDefault();&lt;br /&gt;
                this.myDlg.hide();&lt;br /&gt;
            } );  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tip: be careful with &amp;quot;hide()&amp;quot; method to close your dialog: the dialog and its content is not completely removed from the DOM. It can cause you problems if you try to display the same dialog several times. A good practice is to wrap all the content of your dialog in a &amp;quot;&amp;lt;div id=&#039;myDlgContent&#039;&amp;gt;&amp;quot; div element, and to call &amp;quot;dojo.destroy(&#039;myDlgContent&#039;)&amp;quot; before displaying your dialog.&lt;br /&gt;
&lt;br /&gt;
=== Scoring dialogs ===&lt;br /&gt;
&lt;br /&gt;
Sometimes at the end of a round you want to display a big table that details the points wins in each section of the game.&lt;br /&gt;
&lt;br /&gt;
Example: in Hearts game, we display at the end of each round the number of &amp;quot;heart&amp;quot; cards collected by each player, the player who collected the Queen of Spades, and the total number of points loose by each player.&lt;br /&gt;
&lt;br /&gt;
Scoring dialogs are managed entirely on &#039;&#039;&#039;PHP side&#039;&#039;&#039;, but they are described here as their effects are visible only on client side.&lt;br /&gt;
&lt;br /&gt;
Displaying a scoring dialog is quite simple and is using a special notification type: &amp;quot;tableWindow&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  // on PHP side:&lt;br /&gt;
  $this-&amp;gt;notifyAllPlayers( &amp;quot;tableWindow&amp;quot;, &#039;&#039;, array(&lt;br /&gt;
            &amp;quot;id&amp;quot; =&amp;gt; &#039;finalScoring&#039;,&lt;br /&gt;
            &amp;quot;title&amp;quot; =&amp;gt; clienttranslate(&amp;quot;Title of the scoring dialog&amp;quot;),&lt;br /&gt;
            &amp;quot;table&amp;quot; =&amp;gt; $table&lt;br /&gt;
        ) ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;table&amp;quot; argument is a 2 dimensional PHP array that describe the table you want to display, line by line and column by column.&lt;br /&gt;
&lt;br /&gt;
Example: display an 3x3 array of strings&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   $table = array(&lt;br /&gt;
      array( &amp;quot;one&amp;quot;, &amp;quot;two&amp;quot;, &amp;quot;three&amp;quot; ),    // This is my first line&lt;br /&gt;
      array( &amp;quot;four&amp;quot;, &amp;quot;five&amp;quot;, &amp;quot;six&amp;quot; ),    // This is my second line&lt;br /&gt;
      array( &amp;quot;seven&amp;quot;, &amp;quot;height&amp;quot;, &amp;quot;nine&amp;quot; )    // This is my third line&lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see above, in each &amp;quot;cell&amp;quot; of your array you can display a simple string value. But you can also display a complex value with a template and associated arguments like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   $table = array(&lt;br /&gt;
      array( &amp;quot;one&amp;quot;, &amp;quot;two&amp;quot;, array( &amp;quot;str&amp;quot; =&amp;gt; &amp;quot;a string with an ${argument}&amp;quot;, &amp;quot;args&amp;quot; =&amp;gt; array( &#039;argument&#039; =&amp;gt; &#039;argument_value&#039; )  ) ),&lt;br /&gt;
      array( &amp;quot;four&amp;quot;, &amp;quot;five&amp;quot;, &amp;quot;six&amp;quot; ), &lt;br /&gt;
      array( &amp;quot;seven&amp;quot;, &amp;quot;height&amp;quot;, &amp;quot;nine&amp;quot; )&lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is especially useful when you want to display player names with colors. Example from &amp;quot;Hearts&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $firstRow = array( &#039;&#039; );&lt;br /&gt;
        foreach( $players as $player_id =&amp;gt; $player )&lt;br /&gt;
        {&lt;br /&gt;
            $firstRow[] = array( &#039;str&#039; =&amp;gt; &#039;${player_name}&#039;,&lt;br /&gt;
                                 &#039;args&#039; =&amp;gt; array( &#039;player_name&#039; =&amp;gt; $player[&#039;player_name&#039;] ),&lt;br /&gt;
                                 &#039;type&#039; =&amp;gt; &#039;header&#039;&lt;br /&gt;
                               );&lt;br /&gt;
        }&lt;br /&gt;
        $table[] = $firstRow;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Update players score ==&lt;br /&gt;
&lt;br /&gt;
Increase a player score (with a positive or negative number):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  this.scoreCtrl[ player_id ].incValue( score_delta );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set a player score to a specific value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  this.scoreCtrl[ player_id ].setValue( new_score );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Players panels ==&lt;br /&gt;
&lt;br /&gt;
=== Adding stuff to player&#039;s panel ===&lt;br /&gt;
&lt;br /&gt;
At first, create a new &amp;quot;JS template&amp;quot; string in your template (tpl) file:&lt;br /&gt;
&lt;br /&gt;
(from Reversi example)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var jstpl_player_board = &#039;\&amp;lt;div class=&amp;quot;cp_board&amp;quot;&amp;gt;\&lt;br /&gt;
    &amp;lt;div id=&amp;quot;stoneicon_p${id}&amp;quot; class=&amp;quot;gmk_stoneicon gmk_stoneicon_${color}&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;span id=&amp;quot;stonecount_p${id}&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;\&lt;br /&gt;
&amp;lt;/div&amp;gt;&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you add this piece of code in your JS file to add this template to each player panel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            // Setting up player boards&lt;br /&gt;
            for( var player_id in gamedatas.players )&lt;br /&gt;
            {&lt;br /&gt;
                var player = gamedatas.players[player_id];&lt;br /&gt;
                         &lt;br /&gt;
                // Setting up players boards if needed&lt;br /&gt;
                var player_board_div = $(&#039;player_board_&#039;+player_id);&lt;br /&gt;
                dojo.place( this.format_block(&#039;jstpl_player_board&#039;, player ), player_board_div );&lt;br /&gt;
            }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the code above is of course from your &amp;quot;setup&amp;quot; function in your Javascript).&lt;br /&gt;
&lt;br /&gt;
Very often, you have to distinguish current player and others players. In this case, you just have to create another JS template (ex: jstpl_otherplayer_board) and use it when &amp;quot;player_id&amp;quot; is different than &amp;quot;this.player_id&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Player&#039;s panel disabling/enabling ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.disablePlayerPanel( player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Disable given player panel (the panel background become gray).&lt;br /&gt;
&lt;br /&gt;
Usually, this is used to signal that this played passes, or will be inactive during a while.&lt;br /&gt;
&lt;br /&gt;
Note that the only effect of this is visual. There are no consequences on the behaviour of the panel itself.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.enablePlayerPanel( player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Enable a player panel that has been disabled before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.enableAllPlayerPanels()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Enable all player panels that has been disabled before.&lt;br /&gt;
&lt;br /&gt;
== Image loading ==&lt;br /&gt;
&lt;br /&gt;
See also [[Game_art:_img_directory]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be careful&#039;&#039;&#039;: by default, ALL images of your img directory are loaded on a player&#039;s browser when he loads the game. For this reason, don&#039;t let in your img directory images that are not useful, otherwise it&#039;s going to slowdown the game load.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dontPreloadImage( image_file_name )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using dontPreloadImage, you tell the interface to not preload a specific image in your img directory.&lt;br /&gt;
&lt;br /&gt;
Example of use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.dontPreloadImage( &#039;cards.png&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is particularly useful if for example you have 2 different themes for a game. To accelerate the loading of the game, you can specify to not preload images corresponding to the other theme.&lt;br /&gt;
&lt;br /&gt;
Another example of use: in &amp;quot;Gosu&amp;quot; game with Kamakor extension, you play with 5 sets of cards among 10 available. Cards images are organized by sets, and we only preload the images corresponding to the 5 current sets.&lt;br /&gt;
&lt;br /&gt;
== Other useful stuff ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.hitch&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With dojo.hitch, you can create a callback function that will run with your game object context whatever happen.&lt;br /&gt;
&lt;br /&gt;
Typical example: display a BGA confirmation dialog with a callback function created with dojo.hitch:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        this.confirmationDialog( _(&#039;Are you sure you want to make this?&#039;), dojo.hitch( this, function() {&lt;br /&gt;
            this.ajaxcall( &#039;/mygame/mygame/makeThis.html&#039;, { lock:true }, this, function( result ) {} );&lt;br /&gt;
        } ) );   &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example above, using dojo.hitch, we are sure that the &amp;quot;this&amp;quot; object will be set when the callback is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; updateCounters(counters)&lt;br /&gt;
: Useful for updating game counters in the player panel (such as resources). &lt;br /&gt;
: &#039;counters&#039; arg is an associative array [counter_name_value =&amp;gt; [ &#039;counter_name&#039; =&amp;gt; counter_name_value, &#039;counter_value&#039; =&amp;gt; counter_value_value], ... ]&lt;br /&gt;
: All counters must be referenced in this.gamedatas.counters and will be updated.&lt;br /&gt;
: DOM objects referenced by &#039;counter_name&#039; will have their innerHTML updated with &#039;counter_value&#039;.&lt;br /&gt;
&lt;br /&gt;
== BGA GUI components ==&lt;br /&gt;
&lt;br /&gt;
BGA framework provides some useful ready-to-use components for the game interface:&lt;br /&gt;
&lt;br /&gt;
[[Studio#BGA_Studio_game_components_reference]]&lt;br /&gt;
&lt;br /&gt;
Note that each time you are using an additional component, you must declare it at the top of your Javascript file in the list of modules used.&lt;br /&gt;
&lt;br /&gt;
Example if you are using &amp;quot;ebg.stock&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/stock&amp;quot;  /// &amp;lt;=== we are using ebg.stock module&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Game_interface_logic:_yourgamename.js&amp;diff=901</id>
		<title>Game interface logic: yourgamename.js</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Game_interface_logic:_yourgamename.js&amp;diff=901"/>
		<updated>2013-06-30T13:34:16Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Animations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the main file for your game interface. Here you will define:&lt;br /&gt;
&lt;br /&gt;
* which actions on the page will generate calls to the server&lt;br /&gt;
* what happens when you get a notification for change from the server and how it will show in the browser. &lt;br /&gt;
&lt;br /&gt;
== File structure ==&lt;br /&gt;
&lt;br /&gt;
The details on how the file is structured is described directly with comments on the code skeleton provided to you.&lt;br /&gt;
&lt;br /&gt;
Basically, here&#039;s this structure:&lt;br /&gt;
* constructor: here you can define variable global to your whole interface.&lt;br /&gt;
* setup: this method is called when the page is refreshed, in order you can setup the game interface.&lt;br /&gt;
* onEnteringState: the method is called when entering in a new game state. This way you can customize the view for this game state.&lt;br /&gt;
* onLeavingState: the method is called when leaving a game state.&lt;br /&gt;
* onUpdateActionButtons: called when entering in a new state, in order you can add action buttons in status bar.&lt;br /&gt;
* (utility methods): at this place you can define your utility methods&lt;br /&gt;
* (player&#039;s actions): at this place you can write your handlers for player&#039;s action on the interface (ex: click on an item).&lt;br /&gt;
* setupNotifications: in this method you associate notifications with notification handlers. This way, for each game notification, you trigger a javascript method to handle it and update the game interface.&lt;br /&gt;
* (notification handlers): at this place you can define your notifications handlers.&lt;br /&gt;
&lt;br /&gt;
== General tips ==&lt;br /&gt;
&lt;br /&gt;
; this.player_id&lt;br /&gt;
: Id of the player on whose browser the code is running.&lt;br /&gt;
&lt;br /&gt;
; this.isSpectator&lt;br /&gt;
: Flag set to true if the user at the table is a spectator (not a player).&lt;br /&gt;
: Note: if you want to hide some element for spectators, you&#039;d better use [[Game_interface_stylesheet:_yourgamename.css#spectatorMode|CSS &#039;spectatorMode&#039; class]].&lt;br /&gt;
&lt;br /&gt;
; this.gamedatas&lt;br /&gt;
: Contains your initial set of datas to init the game, created at game start or game refresh (F5)&lt;br /&gt;
: You can update it as needed to keep an up to date reference of the game on the client side if you need it (most of the time you don&#039;t).&lt;br /&gt;
&lt;br /&gt;
; isCurrentPlayerActive()&lt;br /&gt;
: Returns true if the player on whose browser the code is running is currently active (it&#039;s his turn to play)&lt;br /&gt;
&lt;br /&gt;
; this.getActivePlayerId()&lt;br /&gt;
: Return the ID of active player, or null if we are not in a &amp;quot;activeplayer&amp;quot; type state.&lt;br /&gt;
&lt;br /&gt;
; this.getActivePlayers()&lt;br /&gt;
: Return an array with the IDs of players that are currently active (or an empty array if there is not).&lt;br /&gt;
&lt;br /&gt;
== Dojo framework ==&lt;br /&gt;
&lt;br /&gt;
BGA is using the [http://dojotoolkit.org/ Dojo Javascript framework].&lt;br /&gt;
&lt;br /&gt;
The Dojo framework allows us to do complex things easier, and the BGA framework is using Dojo framework a lot.&lt;br /&gt;
&lt;br /&gt;
To realize game although, you only need to use a few part of the Dojo framework. All the Dojo methods you need to use are describe on this page.&lt;br /&gt;
&lt;br /&gt;
== Access and manipulate the DOM ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$(&#039;some_html_element_id&#039;)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The $() function is used to get some HTML element using its &amp;quot;id&amp;quot; attribute.&lt;br /&gt;
&lt;br /&gt;
Example 1: modify the content of a &amp;quot;span&amp;quot; element:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
In your HTML code:&lt;br /&gt;
   &amp;lt;span id=&amp;quot;a_value_in_the_game_interface&amp;quot;&amp;gt;1234&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In your Javascript code:&lt;br /&gt;
   $(&#039;a_value_in_the_game_interface&#039;).innerHTML = &amp;quot;9999&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: $() is the standard method to access some HTML element with BGA Framework. You must not use &amp;quot;getElementById&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.style&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With dojo.style you can modify a CSS property of any HTML element of your interface.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // Make an element disappear&lt;br /&gt;
     dojo.style( &#039;my_element&#039;, &#039;display&#039;, &#039;none&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Give an element a 2px border&lt;br /&gt;
     dojo.style( &#039;my_element&#039;, &#039;borderWidth&#039;, &#039;2px&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Change the background position of an element&lt;br /&gt;
     // (very practical when you are using CSS sprite to transform an element to another)&lt;br /&gt;
     dojo.style( &#039;my_element&#039;, &#039;backgroundPosition&#039;, &#039;-20px -50px&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: you must always use dojo.style to modify CSS properties of HTML elements.&lt;br /&gt;
&lt;br /&gt;
Note²: if you have to modify several CSS properties of an element, or if you have some complex CSS transformation to do, you should consider using dojo.addClass/dojo.removeClass (see below).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo CSS classes manipulation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In many situation, a bunch of many small CSS property update can be replaced by a CSS class change (ie: you add a CSS class to your element instead of applying all modification manually).&lt;br /&gt;
&lt;br /&gt;
Advantages are:&lt;br /&gt;
* All your CSS stuff remains in your CSS file.&lt;br /&gt;
* You can add/remove a list of CSS modifications with a simple function and whithout error.&lt;br /&gt;
* You can test if you applied the stuff to an element with &amp;quot;dojo.hasClass&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Example from &amp;quot;Reversi&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // We add &amp;quot;possibleMove&amp;quot; to an element&lt;br /&gt;
    dojo.addClass( &#039;square_&#039;+x+&#039;_&#039;+y, &#039;possibleMove&#039; );&lt;br /&gt;
&lt;br /&gt;
    // In our CSS file, the class is defined as:&lt;br /&gt;
    .possibleMove {&lt;br /&gt;
      background-color: white;&lt;br /&gt;
      opacity: 0.2;&lt;br /&gt;
      filter:alpha(opacity=20); /* For IE8 and earlier */  &lt;br /&gt;
      cursor: pointer;  &lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     // So we&#039;ve applied 4 CSS property change in one line of code.&lt;br /&gt;
&lt;br /&gt;
     // ... and when we need to check if a square is a possible move on client side:&lt;br /&gt;
     if( dojo.hasClass( &#039;square_&#039;+x+&#039;_&#039;+y, &#039;possibleMove&#039; ) )&lt;br /&gt;
     { ... }&lt;br /&gt;
&lt;br /&gt;
     // ... and if we want to remove all possible moves in one line of code (see &amp;quot;dojo.query&amp;quot; method):&lt;br /&gt;
     dojo.query( &#039;.possibleMove&#039; ).removeClass( &#039;possibleMove&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conclusion: we encourage you to use dojo.addClass, dojo.removeClass and dojo.hasClass to make your life easier :)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.query&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With dojo.query, you can query a bunch of HTML elements with a single function, with a &amp;quot;CSS selector&amp;quot; style.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // All elements with class &amp;quot;possibleMove&amp;quot;:&lt;br /&gt;
     var elements = dojo.query( &#039;.possibleMove&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Count number of tokens (ie: elements with class &amp;quot;token&amp;quot;) on the board (ie: element with id &amp;quot;board&amp;quot;):&lt;br /&gt;
     dojo.query( &#039;#board .token&#039; ).length;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But what is really cool with dojo.query is that you can combine it with almost all methods above.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // Trigger a method when the mouse enter in any element with class &amp;quot;meeple&amp;quot;:&lt;br /&gt;
     dojo.query( &#039;.meeple&#039; ).connect( &#039;onmouseenter&#039;, this, &#039;myMethodToTrigger&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Hide all meeples who are on the board&lt;br /&gt;
     dojo.query( &#039;#board .meeple&#039; ).style( &#039;display&#039;, &#039;none&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.place&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
dojo.place is the best function to insert some HTML code somewhere in your game interface without breaking something. It is much better to use that &amp;quot;innerHTML=&#039;&#039;&amp;quot; method as soon as you must insert HTML tags and not only values.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // Insert your HTML code as a child of a container element&lt;br /&gt;
     dojo.place( &amp;quot;&amp;lt;your html code&amp;gt;&amp;quot;, &amp;quot;your_container_element_id&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
     // Replace the container element with your new html&lt;br /&gt;
     dojo.place( &amp;quot;&amp;lt;your html code&amp;gt;&amp;quot;, &amp;quot;your_container_element_id&amp;quot;, &amp;quot;replace&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the third parameter of dojo.place can take various interesting value: &amp;quot;first&amp;quot;, &amp;quot;after&amp;quot;, ... [http://dojotoolkit.org/reference-guide/1.7/dojo/place.html See full doc on dojo.place].&lt;br /&gt;
&lt;br /&gt;
Usually, when you want to insert some piece of HTML in your game interface, you should use &amp;quot;[[Game_layout:_view_and_template:_yourgamename.view.php_and_yourgamename_yourgamename.tpl#Javascript_templates|Javascript templates]]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addStyleToClass: function( cssClassName, cssProperty, propertyValue )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as dojo.style(), but for all the nodes set with the specified cssClassName&lt;br /&gt;
&lt;br /&gt;
=== Animations ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dojo Animations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
BGA animations is based on Dojo Animation ([http://dojotoolkit.org/documentation/tutorials/1.8/animation/ see tutorial here]).&lt;br /&gt;
&lt;br /&gt;
However, most of the time, you can just use methods below, which are built on top of Dojo Animation.&lt;br /&gt;
&lt;br /&gt;
Note: one interesting method from Dojo that could be useful from time to time is &amp;quot;Dojo.Animation&amp;quot;. It allows you to make any CSS property &amp;quot;slide&amp;quot; from one value to another.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideToObject( mobile_obj, target_obj, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use slideToObject to &amp;quot;slide&amp;quot; an element to a target position.&lt;br /&gt;
&lt;br /&gt;
Sliding element on the game area is the recommended and the most used way to animate your game interface. Using slides allow players to figure out what is happening on the game, as if they were playing with the real boardgame.&lt;br /&gt;
&lt;br /&gt;
The parameters are:&lt;br /&gt;
* mobile_obj: the ID of the object to move. This object must be &amp;quot;relative&amp;quot; or &amp;quot;absolute&amp;quot; positioned.&lt;br /&gt;
* target_obj: the ID of the target object. This object must be &amp;quot;relative&amp;quot; or &amp;quot;absolute&amp;quot; positioned. Note that it is not mandatory that mobile_obj and target_obj have the same size. If their size are different, the system slides the center of mobile_obj to the center of target_obj.&lt;br /&gt;
* duration: (optional) defines the duration in millisecond of the slide. The default is 500 milliseconds.&lt;br /&gt;
* delay: (optional). If you defines a delay, the slide will start only after this delay. This is particularly useful when you want to slide several object from the same position to the same position: you can give a 0ms delay to the first object, a 100ms delay to the second one, a 200ms delay to the third one, ... this way they won&#039;t be superposed during the slide.&lt;br /&gt;
&lt;br /&gt;
BE CAREFUL: The method returns an dojo.fx animation, so you can combine it with other animation if you want to. It means that you have to call the &amp;quot;play()&amp;quot; method, otherwise the animation WON&#039;T START.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.slideToObject( &amp;quot;some_token&amp;quot;, &amp;quot;some_place_on_board&amp;quot; ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideToObjectPos( mobile_obj, target_obj, target_x, target_y, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method does exactly the same than &amp;quot;slideToObjectPos&amp;quot;, except than you can specify some (x,y) coordinates. This way, &amp;quot;mobile_obj&amp;quot; will slide to the specified x,y position relatively to &amp;quot;target_obj&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example: slide a token to some place on the board, 10 pixels to the bottom:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.slideToObjectPos( &amp;quot;some_token&amp;quot;, &amp;quot;some_place_on_board&amp;quot;, 0, 10 ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideTemporaryObject( mobile_obj_html, mobile_obj_parent, from, to, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is useful when you want to slide a temporary HTML object from one place to another. As this object does not exists before the animation and won&#039;t remain after, it could be complex to create this object (with dojo.place), to place it at its origin (with placeOnObject) to slide it (with slideToObject) and to make it disappear at the end.&lt;br /&gt;
&lt;br /&gt;
slideTemporaryObject does all of this for you:&lt;br /&gt;
* mobile_obj_html is a piece of HTML code that represent the object to slide.&lt;br /&gt;
* mobile_obj_parent is the ID of an HTML element of your interface that will be the parent of this temporary HTML object.&lt;br /&gt;
* from is the ID of the origin of the slide.&lt;br /&gt;
* to is the ID of the target of the slide.&lt;br /&gt;
* duration/delay works exactly like in &amp;quot;slideToObject&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.slideTemporaryObject( &#039;&amp;lt;div class=&amp;quot;token_icon&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&#039;, &#039;tokens&#039;, &#039;my_origin_div&#039;, &#039;my_target_div&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideToObjectAndDestroy: function( node, to, time, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is a handy shortcut to slide an existing HTML object to some place then destroy it upon arrival. It can be used for example to move a victory token or a card from the board to the player panel to show that the player earns it, then destroy it when we don&#039;t need to keep it visible on the player panel.&lt;br /&gt;
&lt;br /&gt;
It works the same as this.slideToObject and takes the same arguments. &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.slideToObjectAndDestroy( &amp;quot;some_token&amp;quot;, &amp;quot;some_place_on_board&amp;quot; ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.fadeOutAndDestroy( node )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function fade out the target HTML node, then destroy it.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.fadeOutAndDestroy( &amp;quot;a_card_that_must_disappear&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CAREFUL: the HTML node still exists until during few milliseconds, until the fadeOut has been completed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rotating elements&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can check here [http://jimfulton.info/demos/dojo-animated-rotate.html an example of use] of Dojo to make an element rotate.&lt;br /&gt;
&lt;br /&gt;
This example combines &amp;quot;Dojo.Animation&amp;quot; method and a CSS3 property that allow you to rotate the element.&lt;br /&gt;
&lt;br /&gt;
IMPORTANT: to asses browser compatibility, you must select the CSS property to use just like in the example (see sourcecode below):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        var transform;&lt;br /&gt;
        dojo.forEach(&lt;br /&gt;
            [&#039;transform&#039;, &#039;WebkitTransform&#039;, &#039;msTransform&#039;,&lt;br /&gt;
             &#039;MozTransform&#039;, &#039;OTransform&#039;],&lt;br /&gt;
            function (name) {&lt;br /&gt;
                if (typeof dojo.body().style[name] != &#039;undefined&#039;) {&lt;br /&gt;
                    transform = name;&lt;br /&gt;
                }&lt;br /&gt;
            });&lt;br /&gt;
        // ... and then use &amp;quot;transform&amp;quot; as the name of your CSS property for rotation&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Moving elements ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.placeOnObject( mobile_obj, target_obj )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
placeOnObject works exactly like &amp;quot;slideToObject&amp;quot;, except that the effect is immediate.&lt;br /&gt;
&lt;br /&gt;
This is not really an animation, but placeOnObject is frequently used before starting an animation.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  // (We just created an object &amp;quot;my_new_token&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  // Place the new token on current player board&lt;br /&gt;
  this.placeOnObject( &amp;quot;my_new_token&amp;quot;, &amp;quot;overall_player_board_&amp;quot;+this.player_id );&lt;br /&gt;
  &lt;br /&gt;
  // Then slide it to its position on the board&lt;br /&gt;
  this.slideToObject( &amp;quot;my_new_token&amp;quot;, &amp;quot;a_place_on_board&amp;quot; ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.placeOnObjectPos( mobile_obj, target_obj, target_x, target_y )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method works exactly like placeOnObject, except than you can specify some (x,y) coordinates. This way, &amp;quot;mobile_obj&amp;quot; will be placed to the specified x,y position relatively to &amp;quot;target_obj&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.attachToNewParent( mobile_obj, target_obj )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With this method, you change the HTML parent of &amp;quot;mobile_obj&amp;quot; element. &amp;quot;target_obj&amp;quot; is the new parent of this element. The beauty of &lt;br /&gt;
attachToNewParent is that the mobile_obj element DOES NOT MOVE during this process.&lt;br /&gt;
&lt;br /&gt;
Note: what happens is that the method calculate a relative position of mobile_obj to make sure it does not move after the HTML parent changes.&lt;br /&gt;
&lt;br /&gt;
Why using this method?&lt;br /&gt;
&lt;br /&gt;
Changing the HTML parent of an element can be useful for the following reasons:&lt;br /&gt;
* When the HTML parent moves, all its child are moving with them. If some game elements is no more linked with a parent HTML object, you may want to attach it to another place.&lt;br /&gt;
* The z_order (vertical order of display) depends on the position in the DOM, so you may need to change the parent of some game elements when they are moving in your game area.&lt;br /&gt;
&lt;br /&gt;
CAREFUL: when you attach an HTML element with a new parent, you break all references to this HTML element (ex: dojo.connect).&lt;br /&gt;
&lt;br /&gt;
== Players input ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.connect&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Used to associate a player event with one of your notification method.&lt;br /&gt;
&lt;br /&gt;
Example: associate a click on an element (&amp;quot;my_element&amp;quot;) with one of our method (&amp;quot;onClickOnMyElement&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      dojo.connect( $(&#039;my_element&#039;), &#039;onClick&#039;, this, &#039;onClickOnMyElement&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: this is the only possible correct way to associate a player input event to your code, and you must not use anything else.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.checkAction( &amp;quot;my_action_name&amp;quot; )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Usage: checkAction: function( action, nomessage )&lt;br /&gt;
&lt;br /&gt;
Check if player can do the specified action by taking into account:&lt;br /&gt;
* current game state&lt;br /&gt;
* interface locking (a player can&#039;t do any action if an action is already in progress)&lt;br /&gt;
&lt;br /&gt;
return true if action is authorized (ie: the action is listed as a &amp;quot;possibleaction&amp;quot; in current game state).&lt;br /&gt;
&lt;br /&gt;
return false and display an error message if not (display no message if nomessage parameter is true). The displayed error message could be either &amp;quot;This move is not allowed at this moment&amp;quot; or &amp;quot;An action is already in progress&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  function onClickOnGameElement( evt )&lt;br /&gt;
  {&lt;br /&gt;
     if( this.checkAction( &amp;quot;my_action&amp;quot; ) )&lt;br /&gt;
     {&lt;br /&gt;
        // Do the action&lt;br /&gt;
     }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.ajaxcall( url, parameters, obj_callback, callback, callback_error )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method must be used to send a player input to the game server.&lt;br /&gt;
&lt;br /&gt;
* url: the url of the action to perform. For a game, it must be: &amp;quot;/&amp;lt;mygame&amp;gt;/&amp;lt;mygame&amp;gt;/myAction.html&amp;quot;&lt;br /&gt;
* parameters: an array of parameter to send to the game server. Note that &amp;quot;lock:true&amp;quot; must always be specified in this list of parameter in order the interface can be locked during the server call.&lt;br /&gt;
* obj_callback: must be set to &amp;quot;this&amp;quot;.&lt;br /&gt;
* callback: a function to trigger when the server returns and everything went fine.&lt;br /&gt;
* callback_error: (optional and rarely used) a function to trigger when the server returns an error.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.ajaxcall( &#039;/mygame/mygame/myaction.html&#039;, { lock: true, &lt;br /&gt;
   arg1: myarg1, &lt;br /&gt;
   arg2: myarg2, &lt;br /&gt;
   ...&lt;br /&gt;
}, this, function( result ) {&lt;br /&gt;
   // Do some stuff after a successful call&lt;br /&gt;
} );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restricted arguments names (please don&#039;t use them):&lt;br /&gt;
* &amp;quot;action&amp;quot;&lt;br /&gt;
* &amp;quot;module&amp;quot;&lt;br /&gt;
* &amp;quot;class&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.confirmationDialog()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Display a confirmation dialog with a yes/no choice.&lt;br /&gt;
&lt;br /&gt;
We advice you to NOT use this function unless the player action is really critical and could ruins the game, because it slows down the game and upset players.&lt;br /&gt;
&lt;br /&gt;
Usage: this.confirmationDialog( &amp;quot;Question to displayed&amp;quot;, callback_function_if_click_on_yes );&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.confirmationDialog( _(&#039;Are you sure to use this bonus (points penalty at the end of the game) ?&#039;),&lt;br /&gt;
                         dojo.hitch( this, function() {&lt;br /&gt;
                           this.ajaxcall( &#039;/seasons/seasons/useBonus.html&#039;,&lt;br /&gt;
                                { id:bonus_id, lock:true }, this, function( result ) {} );&lt;br /&gt;
                        } ) ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; addEventToClass: function( cssClassName, eventName, functionName )&lt;br /&gt;
: Same as dojo.connect(), but for all the nodes set with the specified cssClassName&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addActionButton( id, label, method, (opt)depreciated, (opt)bHighlight )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use this method to add an action button in the main action status bar.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* id: a ID that should be unique in your HTML DOM document.&lt;br /&gt;
* label: the text of the button. Should be translatable (use _() function).&lt;br /&gt;
* method: the name of your method that must be triggered when the player clicks on this button.&lt;br /&gt;
* depreciated (optional): do not use this. Please not specify this argument or use &amp;quot;null&amp;quot;.&lt;br /&gt;
* bHighlight: if set to &amp;quot;true&amp;quot;, the button is going blink to catch player&#039;s attention. Please don&#039;t abuse of blinking button.&lt;br /&gt;
&lt;br /&gt;
You should only use this method in your &amp;quot;onUpdateActionButtons&amp;quot; method. Usually, you use it like this (from Hears example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        onUpdateActionButtons: function( stateName, args )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &#039;onUpdateActionButtons: &#039;+stateName );&lt;br /&gt;
                      &lt;br /&gt;
            if( this.isCurrentPlayerActive() )&lt;br /&gt;
            {            &lt;br /&gt;
                switch( stateName )&lt;br /&gt;
                {&lt;br /&gt;
                case &#039;giveCards&#039;:&lt;br /&gt;
                    this.addActionButton( &#039;giveCards_button&#039;, _(&#039;Give selected cards&#039;), &#039;onGiveCards&#039; ); &lt;br /&gt;
                    break;&lt;br /&gt;
&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        },   &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example above, we are adding a &amp;quot;Give selected cards&amp;quot; button in the case we are on game state &amp;quot;giveCards&amp;quot;. When player clicks on this button, it triggers our &amp;quot;onGiveCards&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
See [[Translations]]&lt;br /&gt;
&lt;br /&gt;
== Notifications ==&lt;br /&gt;
&lt;br /&gt;
When something happens on the server side, your game interface Javascript logic received a notification.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how you can handle these notifications on the client side.&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to notifications ===&lt;br /&gt;
&lt;br /&gt;
Your Javascript &amp;quot;setupNotifications&amp;quot; method is the place where you can subscribe to notifications from your PHP code.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how you associate one of your Javascript method to a notification &amp;quot;playDisc&amp;quot; (from Reversi example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   // In setupNotifications method:&lt;br /&gt;
   dojo.subscribe( &#039;playDisc&#039;, this, &amp;quot;notif_playDisc&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the &amp;quot;playDisc&amp;quot; corresponds to the name of the notification you define it in your PHP code, in your &amp;quot;notifyAllPlayers&amp;quot; or &amp;quot;notifyPlayer&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Then, you have to define your &amp;quot;notif_playDisc&amp;quot; method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        notif_playDisc: function( notif )&lt;br /&gt;
        {&lt;br /&gt;
            // Remove current possible moves (makes the board more clear)&lt;br /&gt;
            dojo.query( &#039;.possibleMove&#039; ).removeClass( &#039;possibleMove&#039; );        &lt;br /&gt;
        &lt;br /&gt;
            this.addDiscOnBoard( notif.args.x, notif.args.y, notif.args.player_id );&lt;br /&gt;
        },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a notification handler like our &amp;quot;notif_playDisc&amp;quot; method, you can access to all notifications arguments with &amp;quot;notif.args&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // If you did this on PHP side:&lt;br /&gt;
    self::notifyAllPlayers( &amp;quot;myNotification&amp;quot;, &#039;&#039;, array( &amp;quot;myArgument&amp;quot; =&amp;gt; 3 ) );&lt;br /&gt;
&lt;br /&gt;
    // On Javascript side, you can access the &amp;quot;myArgument&amp;quot; like this:&lt;br /&gt;
    notif_myNotification: function( notif )&lt;br /&gt;
    {&lt;br /&gt;
       alert( &amp;quot;myArgument = &amp;quot; + notif.args.myArgument );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Synchronous notifications ===&lt;br /&gt;
&lt;br /&gt;
When several notifications are received by your game interface, these notifications are processed immediately, one after the other, in the same exact order they have been generated in your PHP game logic.&lt;br /&gt;
&lt;br /&gt;
However, sometimes, you need to give some time to the players to figure out what happened on the game before jumping to the next notification. Indeed, in many games, they are a lot of automatic actions, and the computer is going to resolve all these actions very fast if you don&#039;t tell it not to do so.&lt;br /&gt;
&lt;br /&gt;
As an example, for Reversi, when someone is playing a disc, we want to wait 500 milliseconds before doing anything else in order the opponent player can figure out what move has been played.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how we do this, right after our subscription:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       dojo.subscribe( &#039;playDisc&#039;, this, &amp;quot;notif_playDisc&amp;quot; );&lt;br /&gt;
       this.notifqueue.setSynchronous( &#039;playDisc&#039;, 500 );   // Wait 500 milliseconds after executing the playDisc handler&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tooltips ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltip( nodeId, _( helpString ), _( actionString ), delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add a simple text tooltip to the DOM node.&lt;br /&gt;
&lt;br /&gt;
Specify &#039;helpString&#039; to display some information about &amp;quot;what is this game element?&amp;quot;.&lt;br /&gt;
Specify &#039;actionString&#039; to display some information about &amp;quot;what happens when I click on this element?&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You must specify both helpString and actionString. Most of the time, you use only one and specify a void string (&amp;quot;&amp;quot;) for the other one.&lt;br /&gt;
&lt;br /&gt;
Usually, _() must be used for the text to be marked for translation.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Delay&amp;quot; is an optional parameter. Usually, it is primarily used to specify a zero delay for some game element when the tooltip gives really important information for the game - but remember: no essential information must be placed in tooltips as they won&#039;t be displayed in some browser (see Guidelines).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.addTooltip( &#039;cardcount&#039;, _(&#039;Number of cards in hand&#039;), &#039;&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltipHtml( nodeId, html, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add an HTML tooltip to the DOM node (for more elaborate content such as presenting a bigger version of a card).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltipToClass( cssClass, _( helpString ), _( actionString ), delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add a simple text tooltip to all the DOM nodes set with this cssClass. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT: all concerned nodes must have IDs to get tooltips.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addTooltipHtmlToClass( cssClass, html, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add an HTML tooltip to to all the DOM nodes set with this cssClass (for more elaborate content such as presenting a bigger version of a card).&lt;br /&gt;
&lt;br /&gt;
IMPORTANT: all concerned nodes must have IDs to get tooltips&lt;br /&gt;
&lt;br /&gt;
== Dialogs, warning messages, confirmation dialogs, ... ==&lt;br /&gt;
&lt;br /&gt;
=== Warning messages ===&lt;br /&gt;
&lt;br /&gt;
Sometimes, there is something important that is happening on the game and you have to make sure all players get the message. Most of the time, the evolution of the game situation or the game log is enough, but sometimes you need something more visible.&lt;br /&gt;
&lt;br /&gt;
Ex: someone fulfill one of the end of the game condition, so this is the last turn.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.showMessage( msg, type )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
showMessage shows a message in a big rectangular area on the top of the screen of current player.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;msg&amp;quot; is the string to display. It should be translated.&lt;br /&gt;
* &amp;quot;type&amp;quot; can be set to &amp;quot;info&amp;quot; or &amp;quot;error&amp;quot;. If set to &amp;quot;info&amp;quot;, the message will be an informative message on a white background. If set to &amp;quot;error&amp;quot;, the message will be an error message on a red background.&lt;br /&gt;
&lt;br /&gt;
Important: the normal way to inform players about the progression of the game is the game log. &amp;quot;showMessage&amp;quot; is intrusive and should not be used often.&lt;br /&gt;
&lt;br /&gt;
=== Confirmation dialog ===&lt;br /&gt;
&lt;br /&gt;
When an important action with a lot of consequences is triggered by the player, you may want to propose a confirmation dialog.&lt;br /&gt;
&lt;br /&gt;
CAREFUL: the general guidelines of BGA is to AVOID the use of confirmation dialog. Confirmation dialogs slow down the game and bother players. The players knows that they have to pay attention about each move when they are playing online.&lt;br /&gt;
&lt;br /&gt;
The situation where you should use a confirmation dialog are the following:&lt;br /&gt;
* It must not happen very often during a game.&lt;br /&gt;
* It must be linked to an action that can really &amp;quot;kill a game&amp;quot; if the player do not pay attention.&lt;br /&gt;
* It must be something that can be done by mistake (ex: a link on the action status bar).&lt;br /&gt;
&lt;br /&gt;
How to display a confirmation dialog:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        this.confirmationDialog( _(&#039;Are you sure you want to make this?&#039;), dojo.hitch( this, function() {&lt;br /&gt;
            this.ajaxcall( &#039;/mygame/mygame/makeThis.html&#039;, { lock:true }, this, function( result ) {} );&lt;br /&gt;
        } ) );   &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dialogs ===&lt;br /&gt;
&lt;br /&gt;
At first, you shouldn&#039;t use dialogs windows.&lt;br /&gt;
&lt;br /&gt;
BGA guidelines specify that all game elements should be displayed on the main screen. Players can eventually scroll down to see game elements they don&#039;t need to see anytime, and you may eventually create anchors to move between game area section. Of course dialogs windows are very practical, but the thing is: all players know how to scroll down, and not all players know how to show up your dialog window. In addition, when the dialog shows up, players can&#039;t access the other game components.&lt;br /&gt;
&lt;br /&gt;
Sometimes although, you need to display a dialog window. Here is how you do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  // Create the new dialog. You should store the handler in a member variable to access it later&lt;br /&gt;
  this.myDlg = new dijit.Dialog({ title: _(&amp;quot;my dialog title to translate&amp;quot;) });&lt;br /&gt;
&lt;br /&gt;
  // Create the HTML of my dialog. The best practice here is to use [[Game_layout:_view_and_template:_yourgamename.view.php_and_yourgamename_yourgamename.tpl#Javascript_templates|Javascript templates]]:&lt;br /&gt;
  var html = this.format_block( &#039;jstpl_myDialogTemplate&#039;, { &lt;br /&gt;
                arg1: myArg1,&lt;br /&gt;
                arg2: myArg2,&lt;br /&gt;
                ...&lt;br /&gt;
            } );  &lt;br /&gt;
&lt;br /&gt;
  // Show the dialog&lt;br /&gt;
  this.myDlg.attr(&amp;quot;content&amp;quot;, html );&lt;br /&gt;
  this.myDlg.show(); &lt;br /&gt;
&lt;br /&gt;
  // Now that the dialog has been displayed, you can connect your method to some dialog elements&lt;br /&gt;
  // Example, a &amp;quot;close&amp;quot; button:&lt;br /&gt;
  dojo.connect( $(&#039;closeDlg&#039;), &#039;onclick&#039;, this, function(evt){&lt;br /&gt;
                evt.preventDefault();&lt;br /&gt;
                this.myDlg.hide();&lt;br /&gt;
            } );  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tip: be careful with &amp;quot;hide()&amp;quot; method to close your dialog: the dialog and its content is not completely removed from the DOM. It can cause you problems if you try to display the same dialog several times. A good practice is to wrap all the content of your dialog in a &amp;quot;&amp;lt;div id=&#039;myDlgContent&#039;&amp;gt;&amp;quot; div element, and to call &amp;quot;dojo.destroy(&#039;myDlgContent&#039;)&amp;quot; before displaying your dialog.&lt;br /&gt;
&lt;br /&gt;
=== Scoring dialogs ===&lt;br /&gt;
&lt;br /&gt;
Sometimes at the end of a round you want to display a big table that details the points wins in each section of the game.&lt;br /&gt;
&lt;br /&gt;
Example: in Hearts game, we display at the end of each round the number of &amp;quot;heart&amp;quot; cards collected by each player, the player who collected the Queen of Spades, and the total number of points loose by each player.&lt;br /&gt;
&lt;br /&gt;
Scoring dialogs are managed entirely on &#039;&#039;&#039;PHP side&#039;&#039;&#039;, but they are described here as their effects are visible only on client side.&lt;br /&gt;
&lt;br /&gt;
Displaying a scoring dialog is quite simple and is using a special notification type: &amp;quot;tableWindow&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  // on PHP side:&lt;br /&gt;
  $this-&amp;gt;notifyAllPlayers( &amp;quot;tableWindow&amp;quot;, &#039;&#039;, array(&lt;br /&gt;
            &amp;quot;id&amp;quot; =&amp;gt; &#039;finalScoring&#039;,&lt;br /&gt;
            &amp;quot;title&amp;quot; =&amp;gt; clienttranslate(&amp;quot;Title of the scoring dialog&amp;quot;),&lt;br /&gt;
            &amp;quot;table&amp;quot; =&amp;gt; $table&lt;br /&gt;
        ) ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;table&amp;quot; argument is a 2 dimensional PHP array that describe the table you want to display, line by line and column by column.&lt;br /&gt;
&lt;br /&gt;
Example: display an 3x3 array of strings&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   $table = array(&lt;br /&gt;
      array( &amp;quot;one&amp;quot;, &amp;quot;two&amp;quot;, &amp;quot;three&amp;quot; ),    // This is my first line&lt;br /&gt;
      array( &amp;quot;four&amp;quot;, &amp;quot;five&amp;quot;, &amp;quot;six&amp;quot; ),    // This is my second line&lt;br /&gt;
      array( &amp;quot;seven&amp;quot;, &amp;quot;height&amp;quot;, &amp;quot;nine&amp;quot; )    // This is my third line&lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see above, in each &amp;quot;cell&amp;quot; of your array you can display a simple string value. But you can also display a complex value with a template and associated arguments like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   $table = array(&lt;br /&gt;
      array( &amp;quot;one&amp;quot;, &amp;quot;two&amp;quot;, array( &amp;quot;str&amp;quot; =&amp;gt; &amp;quot;a string with an ${argument}&amp;quot;, &amp;quot;args&amp;quot; =&amp;gt; array( &#039;argument&#039; =&amp;gt; &#039;argument_value&#039; )  ) ),&lt;br /&gt;
      array( &amp;quot;four&amp;quot;, &amp;quot;five&amp;quot;, &amp;quot;six&amp;quot; ), &lt;br /&gt;
      array( &amp;quot;seven&amp;quot;, &amp;quot;height&amp;quot;, &amp;quot;nine&amp;quot; )&lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is especially useful when you want to display player names with colors. Example from &amp;quot;Hearts&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $firstRow = array( &#039;&#039; );&lt;br /&gt;
        foreach( $players as $player_id =&amp;gt; $player )&lt;br /&gt;
        {&lt;br /&gt;
            $firstRow[] = array( &#039;str&#039; =&amp;gt; &#039;${player_name}&#039;,&lt;br /&gt;
                                 &#039;args&#039; =&amp;gt; array( &#039;player_name&#039; =&amp;gt; $player[&#039;player_name&#039;] ),&lt;br /&gt;
                                 &#039;type&#039; =&amp;gt; &#039;header&#039;&lt;br /&gt;
                               );&lt;br /&gt;
        }&lt;br /&gt;
        $table[] = $firstRow;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Update players score ==&lt;br /&gt;
&lt;br /&gt;
Increase a player score (with a positive or negative number):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  this.scoreCtrl[ player_id ].incValue( score_delta );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set a player score to a specific value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  this.scoreCtrl[ player_id ].setValue( new_score );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Players panels ==&lt;br /&gt;
&lt;br /&gt;
=== Adding stuff to player&#039;s panel ===&lt;br /&gt;
&lt;br /&gt;
At first, create a new &amp;quot;JS template&amp;quot; string in your template (tpl) file:&lt;br /&gt;
&lt;br /&gt;
(from Reversi example)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var jstpl_player_board = &#039;\&amp;lt;div class=&amp;quot;cp_board&amp;quot;&amp;gt;\&lt;br /&gt;
    &amp;lt;div id=&amp;quot;stoneicon_p${id}&amp;quot; class=&amp;quot;gmk_stoneicon gmk_stoneicon_${color}&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;span id=&amp;quot;stonecount_p${id}&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;\&lt;br /&gt;
&amp;lt;/div&amp;gt;&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you add this piece of code in your JS file to add this template to each player panel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            // Setting up player boards&lt;br /&gt;
            for( var player_id in gamedatas.players )&lt;br /&gt;
            {&lt;br /&gt;
                var player = gamedatas.players[player_id];&lt;br /&gt;
                         &lt;br /&gt;
                // Setting up players boards if needed&lt;br /&gt;
                var player_board_div = $(&#039;player_board_&#039;+player_id);&lt;br /&gt;
                dojo.place( this.format_block(&#039;jstpl_player_board&#039;, player ), player_board_div );&lt;br /&gt;
            }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the code above is of course from your &amp;quot;setup&amp;quot; function in your Javascript).&lt;br /&gt;
&lt;br /&gt;
Very often, you have to distinguish current player and others players. In this case, you just have to create another JS template (ex: jstpl_otherplayer_board) and use it when &amp;quot;player_id&amp;quot; is different than &amp;quot;this.player_id&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Player&#039;s panel disabling/enabling ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.disablePlayerPanel( player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Disable given player panel (the panel background become gray).&lt;br /&gt;
&lt;br /&gt;
Usually, this is used to signal that this played passes, or will be inactive during a while.&lt;br /&gt;
&lt;br /&gt;
Note that the only effect of this is visual. There are no consequences on the behaviour of the panel itself.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.enablePlayerPanel( player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Enable a player panel that has been disabled before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.enableAllPlayerPanels()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Enable all player panels that has been disabled before.&lt;br /&gt;
&lt;br /&gt;
== Image loading ==&lt;br /&gt;
&lt;br /&gt;
See also [[Game_art:_img_directory]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be careful&#039;&#039;&#039;: by default, ALL images of your img directory are loaded on a player&#039;s browser when he loads the game. For this reason, don&#039;t let in your img directory images that are not useful, otherwise it&#039;s going to slowdown the game load.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dontPreloadImage( image_file_name )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using dontPreloadImage, you tell the interface to not preload a specific image in your img directory.&lt;br /&gt;
&lt;br /&gt;
Example of use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.dontPreloadImage( &#039;cards.png&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is particularly useful if for example you have 2 different themes for a game. To accelerate the loading of the game, you can specify to not preload images corresponding to the other theme.&lt;br /&gt;
&lt;br /&gt;
Another example of use: in &amp;quot;Gosu&amp;quot; game with Kamakor extension, you play with 5 sets of cards among 10 available. Cards images are organized by sets, and we only preload the images corresponding to the 5 current sets.&lt;br /&gt;
&lt;br /&gt;
== Other useful stuff ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.hitch&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With dojo.hitch, you can create a callback function that will run with your game object context whatever happen.&lt;br /&gt;
&lt;br /&gt;
Typical example: display a BGA confirmation dialog with a callback function created with dojo.hitch:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        this.confirmationDialog( _(&#039;Are you sure you want to make this?&#039;), dojo.hitch( this, function() {&lt;br /&gt;
            this.ajaxcall( &#039;/mygame/mygame/makeThis.html&#039;, { lock:true }, this, function( result ) {} );&lt;br /&gt;
        } ) );   &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example above, using dojo.hitch, we are sure that the &amp;quot;this&amp;quot; object will be set when the callback is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; updateCounters(counters)&lt;br /&gt;
: Useful for updating game counters in the player panel (such as resources). &lt;br /&gt;
: &#039;counters&#039; arg is an associative array [counter_name_value =&amp;gt; [ &#039;counter_name&#039; =&amp;gt; counter_name_value, &#039;counter_value&#039; =&amp;gt; counter_value_value], ... ]&lt;br /&gt;
: All counters must be referenced in this.gamedatas.counters and will be updated.&lt;br /&gt;
: DOM objects referenced by &#039;counter_name&#039; will have their innerHTML updated with &#039;counter_value&#039;.&lt;br /&gt;
&lt;br /&gt;
== BGA GUI components ==&lt;br /&gt;
&lt;br /&gt;
BGA framework provides some useful ready-to-use components for the game interface:&lt;br /&gt;
&lt;br /&gt;
[[Studio#BGA_Studio_game_components_reference]]&lt;br /&gt;
&lt;br /&gt;
Note that each time you are using an additional component, you must declare it at the top of your Javascript file in the list of modules used.&lt;br /&gt;
&lt;br /&gt;
Example if you are using &amp;quot;ebg.stock&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/stock&amp;quot;  /// &amp;lt;=== we are using ebg.stock module&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Gamehelpelfenland&amp;diff=888</id>
		<title>Gamehelpelfenland</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Gamehelpelfenland&amp;diff=888"/>
		<updated>2013-06-16T13:00:56Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Goal of the game */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Goal of the game ==&lt;br /&gt;
&lt;br /&gt;
Visiting as many cities as possible in Elfenland over 4 rounds.&lt;br /&gt;
&lt;br /&gt;
At the end of the 4th round, the player who collected the most Town Pieces wins.&lt;br /&gt;
&lt;br /&gt;
We advise you to play with at least 3 players to best enjoy the game (4 or 5 is even better). A lot of the fun comes from using the Transportation Counters set by other players to optimise one&#039;s travels, so the more the merrier!&lt;br /&gt;
&lt;br /&gt;
== Round overview ==&lt;br /&gt;
&lt;br /&gt;
A round is split into phases:&lt;br /&gt;
&lt;br /&gt;
# Each player fills his hand up to 8 cards and gets a secret Transportation Counter.&lt;br /&gt;
# One after another, each player chooses a Transportation Counter from the 5 visible or drawn from the facedown stack, until each player took 3.&lt;br /&gt;
# One after another, each player chooses must plan a travel road by laying a Transportation Counter matching the terrain of the chosen road. This phase goes on until each player has passed consecutively. Each player also owns an Obstacle that he can lay down on a Transportation Counter to up the cost of traveling on this road from 1 card.&lt;br /&gt;
# One after another, each player is going to travel from town to town. The current position of a player is shown by the Elf Boot of his color, initially set on the biggest town, Elvenhold.&lt;br /&gt;
&lt;br /&gt;
At the end of the round, a player can keep a maximum of 4 cards in hand, and keeps only 1 Transportation counter.&lt;br /&gt;
&lt;br /&gt;
== Travel rules ==&lt;br /&gt;
&lt;br /&gt;
Players can travel :&lt;br /&gt;
* on the roads on which a Transportation Counter has been set&lt;br /&gt;
* on the rivers&lt;br /&gt;
* on the lakes.&lt;br /&gt;
&lt;br /&gt;
To travel on a road, a river or a lake, the player needs to pay with the cards in hands the cost matching the terrain of the road and the means of transport used.&lt;br /&gt;
&lt;br /&gt;
For example, if the Transportation Counter &#039;Magic Cloud&#039; has been set on a mountain road, one can travel with just one &#039;Magic Cloud&#039; card. But if it has been set on a forest or plain road, one needs to pay 2 &#039;Magic Cloud&#039; cards to pass (NB: the &#039;Magic Cloud&#039; Transportation Counter cannot be used to travel in the desert, as it&#039;s too hot for a Cloud over there).&lt;br /&gt;
&lt;br /&gt;
Also :&lt;br /&gt;
* To travel a river, you need only 1 &#039;Raft&#039; card to go downriver, but you need 2 to go upriver (look for the small arrows).&lt;br /&gt;
* To cross a lake, you need to pay two &#039;Raft&#039; cards.&lt;br /&gt;
* If an Obstacle has been set on a road, you need to pay 1 more card of the appropriate type.&lt;br /&gt;
* If you don&#039;t have the appropriate cards to travel on a road, you can still pass using a &#039;Caravan&#039;, by paying 3 cards of any type (4 cards if there is an Obstacle on the road).&lt;br /&gt;
&lt;br /&gt;
== Variant ==&lt;br /&gt;
&lt;br /&gt;
In the &#039;Hometown&#039; variant, each player gets a secret town card at the beginning of the game, telling him which town he has to reach at the end of the 4th round.&lt;br /&gt;
&lt;br /&gt;
If he doesn&#039;t manage to get there, he&#039;ll lose as many points as the remaining distance he has to travel to get there.&lt;br /&gt;
&lt;br /&gt;
This variant gives more tactic depth to the game, as you have to plan each round to the best to get the most Town Pieces while making sure to be able to get to your hometown at the end of the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Have a good game!&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Gamehelpelfenland&amp;diff=887</id>
		<title>Gamehelpelfenland</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Gamehelpelfenland&amp;diff=887"/>
		<updated>2013-06-16T12:57:28Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Goal of the game */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Goal of the game ==&lt;br /&gt;
&lt;br /&gt;
Visiting as many cities as possible in Elfenland over 4 rounds.&lt;br /&gt;
&lt;br /&gt;
At the end of the 4th round, the player who collected the most Town Pieces wins.&lt;br /&gt;
&lt;br /&gt;
We advise you to play with at least 3 players to best enjoy the game (4 or 5 is even better). A lot of the fun comes from using the counters from other players to optimise one&#039;s travels, so the more the merrier!&lt;br /&gt;
&lt;br /&gt;
== Round overview ==&lt;br /&gt;
&lt;br /&gt;
A round is split into phases:&lt;br /&gt;
&lt;br /&gt;
# Each player fills his hand up to 8 cards and gets a secret Transportation Counter.&lt;br /&gt;
# One after another, each player chooses a Transportation Counter from the 5 visible or drawn from the facedown stack, until each player took 3.&lt;br /&gt;
# One after another, each player chooses must plan a travel road by laying a Transportation Counter matching the terrain of the chosen road. This phase goes on until each player has passed consecutively. Each player also owns an Obstacle that he can lay down on a Transportation Counter to up the cost of traveling on this road from 1 card.&lt;br /&gt;
# One after another, each player is going to travel from town to town. The current position of a player is shown by the Elf Boot of his color, initially set on the biggest town, Elvenhold.&lt;br /&gt;
&lt;br /&gt;
At the end of the round, a player can keep a maximum of 4 cards in hand, and keeps only 1 Transportation counter.&lt;br /&gt;
&lt;br /&gt;
== Travel rules ==&lt;br /&gt;
&lt;br /&gt;
Players can travel :&lt;br /&gt;
* on the roads on which a Transportation Counter has been set&lt;br /&gt;
* on the rivers&lt;br /&gt;
* on the lakes.&lt;br /&gt;
&lt;br /&gt;
To travel on a road, a river or a lake, the player needs to pay with the cards in hands the cost matching the terrain of the road and the means of transport used.&lt;br /&gt;
&lt;br /&gt;
For example, if the Transportation Counter &#039;Magic Cloud&#039; has been set on a mountain road, one can travel with just one &#039;Magic Cloud&#039; card. But if it has been set on a forest or plain road, one needs to pay 2 &#039;Magic Cloud&#039; cards to pass (NB: the &#039;Magic Cloud&#039; Transportation Counter cannot be used to travel in the desert, as it&#039;s too hot for a Cloud over there).&lt;br /&gt;
&lt;br /&gt;
Also :&lt;br /&gt;
* To travel a river, you need only 1 &#039;Raft&#039; card to go downriver, but you need 2 to go upriver (look for the small arrows).&lt;br /&gt;
* To cross a lake, you need to pay two &#039;Raft&#039; cards.&lt;br /&gt;
* If an Obstacle has been set on a road, you need to pay 1 more card of the appropriate type.&lt;br /&gt;
* If you don&#039;t have the appropriate cards to travel on a road, you can still pass using a &#039;Caravan&#039;, by paying 3 cards of any type (4 cards if there is an Obstacle on the road).&lt;br /&gt;
&lt;br /&gt;
== Variant ==&lt;br /&gt;
&lt;br /&gt;
In the &#039;Hometown&#039; variant, each player gets a secret town card at the beginning of the game, telling him which town he has to reach at the end of the 4th round.&lt;br /&gt;
&lt;br /&gt;
If he doesn&#039;t manage to get there, he&#039;ll lose as many points as the remaining distance he has to travel to get there.&lt;br /&gt;
&lt;br /&gt;
This variant gives more tactic depth to the game, as you have to plan each round to the best to get the most Town Pieces while making sure to be able to get to your hometown at the end of the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Have a good game!&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Gamehelpelfenland&amp;diff=886</id>
		<title>Gamehelpelfenland</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Gamehelpelfenland&amp;diff=886"/>
		<updated>2013-06-16T12:52:46Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Round overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Goal of the game ==&lt;br /&gt;
&lt;br /&gt;
Visiting as many cities as possible in Elfenland over 4 rounds.&lt;br /&gt;
&lt;br /&gt;
At the end of the 4th round, the player who collected the most Town Pieces wins.&lt;br /&gt;
&lt;br /&gt;
== Round overview ==&lt;br /&gt;
&lt;br /&gt;
A round is split into phases:&lt;br /&gt;
&lt;br /&gt;
# Each player fills his hand up to 8 cards and gets a secret Transportation Counter.&lt;br /&gt;
# One after another, each player chooses a Transportation Counter from the 5 visible or drawn from the facedown stack, until each player took 3.&lt;br /&gt;
# One after another, each player chooses must plan a travel road by laying a Transportation Counter matching the terrain of the chosen road. This phase goes on until each player has passed consecutively. Each player also owns an Obstacle that he can lay down on a Transportation Counter to up the cost of traveling on this road from 1 card.&lt;br /&gt;
# One after another, each player is going to travel from town to town. The current position of a player is shown by the Elf Boot of his color, initially set on the biggest town, Elvenhold.&lt;br /&gt;
&lt;br /&gt;
At the end of the round, a player can keep a maximum of 4 cards in hand, and keeps only 1 Transportation counter.&lt;br /&gt;
&lt;br /&gt;
== Travel rules ==&lt;br /&gt;
&lt;br /&gt;
Players can travel :&lt;br /&gt;
* on the roads on which a Transportation Counter has been set&lt;br /&gt;
* on the rivers&lt;br /&gt;
* on the lakes.&lt;br /&gt;
&lt;br /&gt;
To travel on a road, a river or a lake, the player needs to pay with the cards in hands the cost matching the terrain of the road and the means of transport used.&lt;br /&gt;
&lt;br /&gt;
For example, if the Transportation Counter &#039;Magic Cloud&#039; has been set on a mountain road, one can travel with just one &#039;Magic Cloud&#039; card. But if it has been set on a forest or plain road, one needs to pay 2 &#039;Magic Cloud&#039; cards to pass (NB: the &#039;Magic Cloud&#039; Transportation Counter cannot be used to travel in the desert, as it&#039;s too hot for a Cloud over there).&lt;br /&gt;
&lt;br /&gt;
Also :&lt;br /&gt;
* To travel a river, you need only 1 &#039;Raft&#039; card to go downriver, but you need 2 to go upriver (look for the small arrows).&lt;br /&gt;
* To cross a lake, you need to pay two &#039;Raft&#039; cards.&lt;br /&gt;
* If an Obstacle has been set on a road, you need to pay 1 more card of the appropriate type.&lt;br /&gt;
* If you don&#039;t have the appropriate cards to travel on a road, you can still pass using a &#039;Caravan&#039;, by paying 3 cards of any type (4 cards if there is an Obstacle on the road).&lt;br /&gt;
&lt;br /&gt;
== Variant ==&lt;br /&gt;
&lt;br /&gt;
In the &#039;Hometown&#039; variant, each player gets a secret town card at the beginning of the game, telling him which town he has to reach at the end of the 4th round.&lt;br /&gt;
&lt;br /&gt;
If he doesn&#039;t manage to get there, he&#039;ll lose as many points as the remaining distance he has to travel to get there.&lt;br /&gt;
&lt;br /&gt;
This variant gives more tactic depth to the game, as you have to plan each round to the best to get the most Town Pieces while making sure to be able to get to your hometown at the end of the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Have a good game!&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Gamehelpelfenland&amp;diff=885</id>
		<title>Gamehelpelfenland</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Gamehelpelfenland&amp;diff=885"/>
		<updated>2013-06-16T12:50:55Z</updated>

		<summary type="html">&lt;p&gt;Een: Created page with &amp;quot;== Goal of the game ==  Visiting as many cities as possible in Elfenland over 4 rounds.  At the end of the 4th round, the player who collected the most Town Pieces wins.  == R...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Goal of the game ==&lt;br /&gt;
&lt;br /&gt;
Visiting as many cities as possible in Elfenland over 4 rounds.&lt;br /&gt;
&lt;br /&gt;
At the end of the 4th round, the player who collected the most Town Pieces wins.&lt;br /&gt;
&lt;br /&gt;
== Round overview ==&lt;br /&gt;
&lt;br /&gt;
A round is split into phases:&lt;br /&gt;
&lt;br /&gt;
# Each player fills his hand up to 8 cards and gets a secret Transportation Counter.&lt;br /&gt;
# One after another, each player chooses a Transportation Counter from the 5 visible or drawn from the facedown stack, until each player took 3.&lt;br /&gt;
# One after another, each player chooses must plan a travel road by laying a Transportation Counter matching the terrain of the chosen road. This phase goes on until each player has passed consecutively. Each player also owns an Obstacle that he can lay down on a Transportation Counter to up the cost of traveling on this road from 1 card.&lt;br /&gt;
# One after another, each player is going to travel from town to town. The current position of a player is shown by the Elf Boot of his color, initially set on the biggest town, Elvenhold.&lt;br /&gt;
&lt;br /&gt;
== Travel rules ==&lt;br /&gt;
&lt;br /&gt;
Players can travel :&lt;br /&gt;
* on the roads on which a Transportation Counter has been set&lt;br /&gt;
* on the rivers&lt;br /&gt;
* on the lakes.&lt;br /&gt;
&lt;br /&gt;
To travel on a road, a river or a lake, the player needs to pay with the cards in hands the cost matching the terrain of the road and the means of transport used.&lt;br /&gt;
&lt;br /&gt;
For example, if the Transportation Counter &#039;Magic Cloud&#039; has been set on a mountain road, one can travel with just one &#039;Magic Cloud&#039; card. But if it has been set on a forest or plain road, one needs to pay 2 &#039;Magic Cloud&#039; cards to pass (NB: the &#039;Magic Cloud&#039; Transportation Counter cannot be used to travel in the desert, as it&#039;s too hot for a Cloud over there).&lt;br /&gt;
&lt;br /&gt;
Also :&lt;br /&gt;
* To travel a river, you need only 1 &#039;Raft&#039; card to go downriver, but you need 2 to go upriver (look for the small arrows).&lt;br /&gt;
* To cross a lake, you need to pay two &#039;Raft&#039; cards.&lt;br /&gt;
* If an Obstacle has been set on a road, you need to pay 1 more card of the appropriate type.&lt;br /&gt;
* If you don&#039;t have the appropriate cards to travel on a road, you can still pass using a &#039;Caravan&#039;, by paying 3 cards of any type (4 cards if there is an Obstacle on the road).&lt;br /&gt;
&lt;br /&gt;
== Variant ==&lt;br /&gt;
&lt;br /&gt;
In the &#039;Hometown&#039; variant, each player gets a secret town card at the beginning of the game, telling him which town he has to reach at the end of the 4th round.&lt;br /&gt;
&lt;br /&gt;
If he doesn&#039;t manage to get there, he&#039;ll lose as many points as the remaining distance he has to travel to get there.&lt;br /&gt;
&lt;br /&gt;
This variant gives more tactic depth to the game, as you have to plan each round to the best to get the most Town Pieces while making sure to be able to get to your hometown at the end of the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Have a good game!&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=867</id>
		<title>Moderationpolicy</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=867"/>
		<updated>2013-05-30T19:13:08Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Penalty grid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== General rules ==&lt;br /&gt;
&lt;br /&gt;
=== Beyond a Reasonable Doubt ===&lt;br /&gt;
&lt;br /&gt;
In case there is a any possible doubt, a player should be considered not guilty.&lt;br /&gt;
&lt;br /&gt;
=== Moderators independance ===&lt;br /&gt;
&lt;br /&gt;
Moderators must not process reports if they know the protagonists (author or targeted player). Playing online with the protagonist does not mean to &amp;quot;know&amp;quot; them. &amp;quot;Know&amp;quot; means: know them personally or playing with them online very regularly.&lt;br /&gt;
&lt;br /&gt;
=== Appeal ===&lt;br /&gt;
&lt;br /&gt;
Players has the right to appeal against the moderation decision, by forwarding received moderation email to &amp;quot;contact@boardgamearena.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
They &#039;&#039;&#039;MUST&#039;&#039;&#039; explain in the email why the moderator did not respect the BGA moderation policy. If the explanation is not convincing, the email will be ignored. If the player is obviously guilty and if the moderation policy hasn&#039;t been violated, BGA admins will double the penalties.&lt;br /&gt;
&lt;br /&gt;
=== Penalty grid ===&lt;br /&gt;
&lt;br /&gt;
Moderators should respect the penalties grid as much as possible. However, they have the right to adjust the penalty depending on the gravity of the case. The following situation can lead moderators to increase the penalties:&lt;br /&gt;
* the player has been reported several times for the same type of case.&lt;br /&gt;
* the player wrong action can be obviously qualified by one or several of the following terms: racism, xenophobia, homophobia, sexism, and as a rule of thumb any type of discrimination against a particular category of people.&lt;br /&gt;
* on case there is a provocation, the penalty may be be reduced a little, and the author of the provocation may have a warning BUT, as everyone should keep quiet and polite even if there are provoked, this is a moderator choice.&lt;br /&gt;
&lt;br /&gt;
=== Relapse ===&lt;br /&gt;
&lt;br /&gt;
In case there is a relapse, the penalty increases exponentially.&lt;br /&gt;
&lt;br /&gt;
This is the moderator job to determine the right penalty to apply in this case, considering the fact that the player has been warned by a first penalty.&lt;br /&gt;
&lt;br /&gt;
Moderators should consider there is a relapse only if the new wrong action occurs AFTER the previous penalty has been applied and the associated moderation email has been sent.&lt;br /&gt;
&lt;br /&gt;
Considering it&#039;s a lot of work to analyze reports about players who do the same action again and again, the &amp;quot;ban forever&amp;quot; penalty can be applied to any case if the player relapses.&lt;br /&gt;
&lt;br /&gt;
=== Special urgency ban procedure ===&lt;br /&gt;
&lt;br /&gt;
Whatever the case type, moderators has the right to ban a player from the website (forever) if this player set up a situation that is out of control and must be stopped within hours. This special procedure should only be used if there is an immediate danger for the community (ex: vandalism, flow of insults, massive spam, ...).&lt;br /&gt;
&lt;br /&gt;
=== About private jokes ===&lt;br /&gt;
&lt;br /&gt;
If a wrong action happened in a private circle (ex: at a game table, with no spectators), and if none of the present players reported the action, the moderator must consider this was a &amp;quot;private joke&amp;quot; and must not apply any penalty. In the contrary, if the wrong action is public (ex: post/comment on the wall), the moderator may consider this as a wrong action even if there is no report.&lt;br /&gt;
&lt;br /&gt;
=== Prescription ===&lt;br /&gt;
&lt;br /&gt;
For operational reason, a report that is older than 2 weeks may be closed by moderators because it is too old.&lt;br /&gt;
&lt;br /&gt;
=== Player profile influence ===&lt;br /&gt;
&lt;br /&gt;
The player profile IS taken into account to determine if the player is guilty or not guilty. Moderators give more credit to players with a good profile than the other.&lt;br /&gt;
&lt;br /&gt;
The player profile is NOT taken into account when choosing the penalty if the player is found guilty.&lt;br /&gt;
&lt;br /&gt;
Good profile elements are:&lt;br /&gt;
* A good thumb up / thumb down ratio.&lt;br /&gt;
* Player is registered since a long time / has a lot of games played.&lt;br /&gt;
* Players is involved in the website (ex: realized translations).&lt;br /&gt;
* Player is supporting BGA (member of the club).&lt;br /&gt;
&lt;br /&gt;
=== Incomplete reports ===&lt;br /&gt;
&lt;br /&gt;
Analyzing reports takes a lot of time, and many reports are received. If any needed information is missing in the report, moderators may (and most of the time, should) close the report.&lt;br /&gt;
&lt;br /&gt;
== Penalty grid ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot;&lt;br /&gt;
|+ Titre&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Category&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Case type&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Details&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Standard penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults during a game, on table chat&lt;br /&gt;
 | Must be present in the report: table ID, and the insults terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on general chat&lt;br /&gt;
 | Must be present in the report: the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 30 days for small insults and insanity, Devilkin forever for real insults. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on public space (wall, forum, comments...)&lt;br /&gt;
 | Must be present in the report: where to find the insult, the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Aggressive attitude&lt;br /&gt;
 | Aggressive attitude during a game: can&#039;t wait the other player, provocation, ...&lt;br /&gt;
 | As a rule of thumb: as long as there is no insult, this is not an issue: thumb down are the solution. BUT, if the player is really borderline and should be warned, a moderation action is needed.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should explain that this is a small warning, and that a change of attitude is needed.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate avatar: porn, extreme violence, advertising...&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Avatar is really inappropriate in 3 cases:&lt;br /&gt;
1°) It can hurt underage players (porn, extreme violence)&lt;br /&gt;
2°) This is advertisement / this violate some intellectual property&lt;br /&gt;
3°) The avatar contains a reference that discriminate a group of people (ex: nazi cross)&lt;br /&gt;
 | Avatar immediate removal + Devilkin 3 days to devilkin forever depending on the gravity. In any case: the player should be warn that this is the last warning before ban. If the player obviously don&#039;t measure the meaning of the avatar, the penalty can be reduced.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate username&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Username are inappropriate when this is obviously an insult for many people. Moderators shouldn&#039;t moderate a username that is insulting by accident in a language that is not widely used on BGA.&lt;br /&gt;
 | Ban from the website. Moderators should explain that the player is welcome with another username on BGA. Note that if the player has a long seniority on BGA (=many games played), moderators should be very cautious on the case: if no one noticed the username until now, it is probably not inappropriate.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Table description&lt;br /&gt;
 | Inappropriate table description&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Table description is inappropriate when it contains insults, insanity, or tend to discriminate a group of people. &lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Kingmaking&lt;br /&gt;
 | Kingmaking action during a game&lt;br /&gt;
 | The report must contains the table id, the exact move number, and the exact explanation why this is a kingmaking action. To declare a player guilty, the player must have played an obvious move against his own interest, and it has to be a good player (clues: his ELO, number of game played, ...). As the difference between a mistake and a kingmaking action is very tight, one kingmaking report is not enough to find a player guilty: only players who regularly play against their interest should be found guilty.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Bug exploit&lt;br /&gt;
 | Exploit a known bug during a game&lt;br /&gt;
 | The bug must have been reported in the forum, and an exact reference to this bug must be in the report, with the table id and the move number. Minor bugs that can be considered as &amp;quot;variants&amp;quot; are NOT concerned (ex: pick 4 cards instead of 3). Bugs that violate the spirit of the game are concerned.&lt;br /&gt;
 | No penalty applies: if there is a bug that has been widely used for a game, a global ELO reset (or an ELO adjustment for players who exploited the bug) will be done. &lt;br /&gt;
 |-&lt;br /&gt;
 ! Private information&lt;br /&gt;
 | Some player gives some private information during the game&lt;br /&gt;
 | Players have the right to pretend things during a game. As these infos could be true or false, and could be exploited by other players too, moderators should be cautious when judging these cases. This case concerns players that had a strong intent to kill the pleasure of the game by giving some private information during the game.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Multiple accounts&lt;br /&gt;
 | A player is using multiple accounts (most of the time: to boost his ELO rank)&lt;br /&gt;
 | The report must contains the usernames of all intimidated accounts, and the reason why the report author think that multiple accounts are used. It is very difficult to find out if different accounts corresponds to different person. For example: BGA accepts that multiple players plays from the same IP address, to allow people from the same family to play at the same table. In addition, some players are using multiple accounts, but these accounts are not playing together (which is acceptable). Strong tools are available for moderators to detect multiple accounts that are used the wrong way.&lt;br /&gt;
 | For secondary accounts: ban forever. For main account: ELO reseted to 1500 / ELO penalty for all games.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Translation stealing / vandalism&lt;br /&gt;
 | The player is writing inappropriate / poor quality translations (or writes a lot of very minor modifications to someone else translation) to gain free club membership, &lt;br /&gt;
 | Immediate ban from the website (to avoid vandalism).&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player is slow to play&lt;br /&gt;
 | Players have the right to think as long as they do not go over their allotted time. If the player is slow on purpose, the good answer is: thumb down.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player quit the game before the end&lt;br /&gt;
 | In this case, player automatically gets a ELO penalty + a red mark on his profile. There is no need to do something else.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
&lt;br /&gt;
 |}&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=866</id>
		<title>Moderationpolicy</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=866"/>
		<updated>2013-05-30T18:52:46Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Player profile influence */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== General rules ==&lt;br /&gt;
&lt;br /&gt;
=== Beyond a Reasonable Doubt ===&lt;br /&gt;
&lt;br /&gt;
In case there is a any possible doubt, a player should be considered not guilty.&lt;br /&gt;
&lt;br /&gt;
=== Moderators independance ===&lt;br /&gt;
&lt;br /&gt;
Moderators must not process reports if they know the protagonists (author or targeted player). Playing online with the protagonist does not mean to &amp;quot;know&amp;quot; them. &amp;quot;Know&amp;quot; means: know them personally or playing with them online very regularly.&lt;br /&gt;
&lt;br /&gt;
=== Appeal ===&lt;br /&gt;
&lt;br /&gt;
Players has the right to appeal against the moderation decision, by forwarding received moderation email to &amp;quot;contact@boardgamearena.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
They &#039;&#039;&#039;MUST&#039;&#039;&#039; explain in the email why the moderator did not respect the BGA moderation policy. If the explanation is not convincing, the email will be ignored. If the player is obviously guilty and if the moderation policy hasn&#039;t been violated, BGA admins will double the penalties.&lt;br /&gt;
&lt;br /&gt;
=== Penalty grid ===&lt;br /&gt;
&lt;br /&gt;
Moderators should respect the penalties grid as much as possible. However, they have the right to adjust the penalty depending on the gravity of the case. The following situation can lead moderators to increase the penalties:&lt;br /&gt;
* the player has been reported several times for the same type of case.&lt;br /&gt;
* the player wrong action can be obviously qualified by one or several of the following terms: racism, xenophobia, homophobia, sexism, and as a rule of thumb any type of discrimination against a particular category of people.&lt;br /&gt;
* on case there is a provocation, the penalty may be be reduced a little, and the author of the provocation may have a warning BUT, as everyone should keep quiet and polite even if there are provoked, this is a moderator choice.&lt;br /&gt;
&lt;br /&gt;
=== Relapse ===&lt;br /&gt;
&lt;br /&gt;
In case there is a relapse, the penalty increases exponentially.&lt;br /&gt;
&lt;br /&gt;
This is the moderator job to determine the right penalty to apply in this case, considering the fact that the player has been warned by a first penalty.&lt;br /&gt;
&lt;br /&gt;
Moderators should consider there is a relapse only if the new wrong action occurs AFTER the previous penalty has been applied and the associated moderation email has been sent.&lt;br /&gt;
&lt;br /&gt;
Considering it&#039;s a lot of work to analyze reports about players who do the same action again and again, the &amp;quot;ban forever&amp;quot; penalty can be applied to any case if the player relapses.&lt;br /&gt;
&lt;br /&gt;
=== Special urgency ban procedure ===&lt;br /&gt;
&lt;br /&gt;
Whatever the case type, moderators has the right to ban a player from the website (forever) if this player set up a situation that is out of control and must be stopped within hours. This special procedure should only be used if there is an immediate danger for the community (ex: vandalism, flow of insults, massive spam, ...).&lt;br /&gt;
&lt;br /&gt;
=== About private jokes ===&lt;br /&gt;
&lt;br /&gt;
If a wrong action happened in a private circle (ex: at a game table, with no spectators), and if none of the present players reported the action, the moderator must consider this was a &amp;quot;private joke&amp;quot; and must not apply any penalty. In the contrary, if the wrong action is public (ex: post/comment on the wall), the moderator may consider this as a wrong action even if there is no report.&lt;br /&gt;
&lt;br /&gt;
=== Prescription ===&lt;br /&gt;
&lt;br /&gt;
For operational reason, a report that is older than 2 weeks may be closed by moderators because it is too old.&lt;br /&gt;
&lt;br /&gt;
=== Player profile influence ===&lt;br /&gt;
&lt;br /&gt;
The player profile IS taken into account to determine if the player is guilty or not guilty. Moderators give more credit to players with a good profile than the other.&lt;br /&gt;
&lt;br /&gt;
The player profile is NOT taken into account when choosing the penalty if the player is found guilty.&lt;br /&gt;
&lt;br /&gt;
Good profile elements are:&lt;br /&gt;
* A good thumb up / thumb down ratio.&lt;br /&gt;
* Player is registered since a long time / has a lot of games played.&lt;br /&gt;
* Players is involved in the website (ex: realized translations).&lt;br /&gt;
* Player is supporting BGA (member of the club).&lt;br /&gt;
&lt;br /&gt;
=== Incomplete reports ===&lt;br /&gt;
&lt;br /&gt;
Analyzing reports takes a lot of time, and many reports are received. If any needed information is missing in the report, moderators may (and most of the time, should) close the report.&lt;br /&gt;
&lt;br /&gt;
== Penalty grid ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot;&lt;br /&gt;
|+ Titre&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Category&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Case type&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Details&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Standard penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults during a game, on table chat&lt;br /&gt;
 | Must be present in the report: table ID, and the insults terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on general chat&lt;br /&gt;
 | Must be present in the report: the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 30 days for small insults and insanity, Devilkin forever for real insults. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on public space (wall, forum, comments...)&lt;br /&gt;
 | Must be present in the report: where to find the insult, the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Aggressive attitude&lt;br /&gt;
 | Aggressive attitude during a game: can&#039;t wait the other player, provocation, ...&lt;br /&gt;
 | As a rule of thumb: as long as there is no insult, this is not an issue: thumb down are the solution. BUT, if the player is really borderline and should be warned, a moderation action is needed.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should explain that this is a small warning, and that a change of attitude is needed.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate avatar: porn, extreme violence, advertising...&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Avatar is really inappropriate in 3 cases:&lt;br /&gt;
1°) It can hurt underage players (porn, extreme violence)&lt;br /&gt;
2°) This is advertisement / this violate some intellectual property&lt;br /&gt;
3°) The avatar contains a reference that discriminate a group of people (ex: nazi cross)&lt;br /&gt;
 | Avatar immediate removal + Devilkin 3 days to devilkin forever depending on the gravity. In any case: the player should be warn that this is the last warning before ban. If the player obviously don&#039;t measure the meaning of the avatar, the penalty can be reduced.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate username&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Username are inappropriate when this is obviously an insult for many people. Moderators shouldn&#039;t moderate a username that is insulting by accident in a language that is not widely used on BGA.&lt;br /&gt;
 | Ban from the website. Moderators should explain that the player is welcome with another username on BGA. Note that if the player has a long seniority on BGA (=many games played), moderators should be very cautious on the case: if no one notice the username until now, it is probably not inappropriate.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Table description&lt;br /&gt;
 | Inappropriate table description&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Table description is inappropriate when it contains insults, insanity, or tend to discriminate a group of people. &lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Kingmaking&lt;br /&gt;
 | Kingmaking action during a game&lt;br /&gt;
 | The report must contains the table id, the exact move number, and the exact explanation why this is a kingmaking action. To declare a player guilty, the player must have played an obvious move against his own interest, and it have to be a good player (clues: his ELO, number of game played, ...). As the difference between a mistake and a kingmaking action is very tight, one kingmaking report is not enough to find a player guilty: only players who regularly play against their interest should be found guilty.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Bug exploit&lt;br /&gt;
 | Exploit a known bug during a game&lt;br /&gt;
 | The bug must have been reported in the forum, and an exact reference to this bug must be in the report, with the table id and the move number. Minor bugs that can be considered as &amp;quot;variants&amp;quot; are NOT concerned (ex: pick 4 cards instead of 3). Bugs that violate the spirit of the game are concerned.&lt;br /&gt;
 | No penalty applies: if there is a bug that has been widely used for a game, a global ELO reset (or an ELO adjustment for players who exploited the bug) will be done. &lt;br /&gt;
 |-&lt;br /&gt;
 ! Private information&lt;br /&gt;
 | Some player gives some private information during the game&lt;br /&gt;
 | Players have the right to pretend things during a game. As these infos could be true or false, and could be exploited by other players too, moderators should be cautious when judging these cases. This case concerns players that had a strong voluntee to kill the pleasure of the game by giving some private information during the game.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Multiple accounts&lt;br /&gt;
 | A player is using multiple accounts (most of the time: to boost his ELO rank)&lt;br /&gt;
 | The report must contains the usernames of all intimidated accounts, and the reason why the report author think that multiple accounts are used. This is very difficult to find out if different accounts corresponds to different person. For example: BGA accepts that multiple players plays from the same IP adress, to allow people from the same family to play at the same table. In addition, some players are using multiple accounts, but these accounts are not playing together (which is acceptable). Strong tools are available for moderators to detect multiple accounts that are used the wrong way.&lt;br /&gt;
 | For secondary accounts: ban forever. For main account: ELO reseted to 1500 / ELO penalty for all games.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Tranlation stealing / vandalism&lt;br /&gt;
 | The player is writing inapropriate / poor quality translations (or writes a lot of very minor modifications to someone else translation) to gain free club membership, &lt;br /&gt;
 | Immediate ban from the website (to avoid vandalism).&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player is slow to play&lt;br /&gt;
 | Players have the right to think as long as they do not go over their alloted time. If the player is slow on purpose, the good answer is: thumb down.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player quit the game before the end&lt;br /&gt;
 | In this case, player automatically gets a ELO penalty + a red mark on his profile. There is no need to do something else.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
&lt;br /&gt;
 |}&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=865</id>
		<title>Moderationpolicy</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=865"/>
		<updated>2013-05-30T18:52:15Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Player profile influence */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== General rules ==&lt;br /&gt;
&lt;br /&gt;
=== Beyond a Reasonable Doubt ===&lt;br /&gt;
&lt;br /&gt;
In case there is a any possible doubt, a player should be considered not guilty.&lt;br /&gt;
&lt;br /&gt;
=== Moderators independance ===&lt;br /&gt;
&lt;br /&gt;
Moderators must not process reports if they know the protagonists (author or targeted player). Playing online with the protagonist does not mean to &amp;quot;know&amp;quot; them. &amp;quot;Know&amp;quot; means: know them personally or playing with them online very regularly.&lt;br /&gt;
&lt;br /&gt;
=== Appeal ===&lt;br /&gt;
&lt;br /&gt;
Players has the right to appeal against the moderation decision, by forwarding received moderation email to &amp;quot;contact@boardgamearena.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
They &#039;&#039;&#039;MUST&#039;&#039;&#039; explain in the email why the moderator did not respect the BGA moderation policy. If the explanation is not convincing, the email will be ignored. If the player is obviously guilty and if the moderation policy hasn&#039;t been violated, BGA admins will double the penalties.&lt;br /&gt;
&lt;br /&gt;
=== Penalty grid ===&lt;br /&gt;
&lt;br /&gt;
Moderators should respect the penalties grid as much as possible. However, they have the right to adjust the penalty depending on the gravity of the case. The following situation can lead moderators to increase the penalties:&lt;br /&gt;
* the player has been reported several times for the same type of case.&lt;br /&gt;
* the player wrong action can be obviously qualified by one or several of the following terms: racism, xenophobia, homophobia, sexism, and as a rule of thumb any type of discrimination against a particular category of people.&lt;br /&gt;
* on case there is a provocation, the penalty may be be reduced a little, and the author of the provocation may have a warning BUT, as everyone should keep quiet and polite even if there are provoked, this is a moderator choice.&lt;br /&gt;
&lt;br /&gt;
=== Relapse ===&lt;br /&gt;
&lt;br /&gt;
In case there is a relapse, the penalty increases exponentially.&lt;br /&gt;
&lt;br /&gt;
This is the moderator job to determine the right penalty to apply in this case, considering the fact that the player has been warned by a first penalty.&lt;br /&gt;
&lt;br /&gt;
Moderators should consider there is a relapse only if the new wrong action occurs AFTER the previous penalty has been applied and the associated moderation email has been sent.&lt;br /&gt;
&lt;br /&gt;
Considering it&#039;s a lot of work to analyze reports about players who do the same action again and again, the &amp;quot;ban forever&amp;quot; penalty can be applied to any case if the player relapses.&lt;br /&gt;
&lt;br /&gt;
=== Special urgency ban procedure ===&lt;br /&gt;
&lt;br /&gt;
Whatever the case type, moderators has the right to ban a player from the website (forever) if this player set up a situation that is out of control and must be stopped within hours. This special procedure should only be used if there is an immediate danger for the community (ex: vandalism, flow of insults, massive spam, ...).&lt;br /&gt;
&lt;br /&gt;
=== About private jokes ===&lt;br /&gt;
&lt;br /&gt;
If a wrong action happened in a private circle (ex: at a game table, with no spectators), and if none of the present players reported the action, the moderator must consider this was a &amp;quot;private joke&amp;quot; and must not apply any penalty. In the contrary, if the wrong action is public (ex: post/comment on the wall), the moderator may consider this as a wrong action even if there is no report.&lt;br /&gt;
&lt;br /&gt;
=== Prescription ===&lt;br /&gt;
&lt;br /&gt;
For operational reason, a report that is older than 2 weeks may be closed by moderators because it is too old.&lt;br /&gt;
&lt;br /&gt;
=== Player profile influence ===&lt;br /&gt;
&lt;br /&gt;
The player profile IS taken into account to determine if the player is guilty or not guilty. Moderators give more credit to players with a good profile than the other.&lt;br /&gt;
&lt;br /&gt;
The player profile is NOT taken into account when choosing the penalty if the player is found guilty.&lt;br /&gt;
&lt;br /&gt;
Good profile elements are:&lt;br /&gt;
* A good thumb up / thumb down ratio.&lt;br /&gt;
* Player is registered since a long time / has a lot of games player.&lt;br /&gt;
* Players is involved in the website (ex: realized translations).&lt;br /&gt;
* Player is supporting BGA (member of the club).&lt;br /&gt;
&lt;br /&gt;
=== Incomplete reports ===&lt;br /&gt;
&lt;br /&gt;
Analyzing reports takes a lot of time, and many reports are received. If any needed information is missing in the report, moderators may (and most of the time, should) close the report.&lt;br /&gt;
&lt;br /&gt;
== Penalty grid ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot;&lt;br /&gt;
|+ Titre&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Category&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Case type&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Details&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Standard penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults during a game, on table chat&lt;br /&gt;
 | Must be present in the report: table ID, and the insults terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on general chat&lt;br /&gt;
 | Must be present in the report: the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 30 days for small insults and insanity, Devilkin forever for real insults. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on public space (wall, forum, comments...)&lt;br /&gt;
 | Must be present in the report: where to find the insult, the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Aggressive attitude&lt;br /&gt;
 | Aggressive attitude during a game: can&#039;t wait the other player, provocation, ...&lt;br /&gt;
 | As a rule of thumb: as long as there is no insult, this is not an issue: thumb down are the solution. BUT, if the player is really borderline and should be warned, a moderation action is needed.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should explain that this is a small warning, and that a change of attitude is needed.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate avatar: porn, extreme violence, advertising...&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Avatar is really inappropriate in 3 cases:&lt;br /&gt;
1°) It can hurt underage players (porn, extreme violence)&lt;br /&gt;
2°) This is advertisement / this violate some intellectual property&lt;br /&gt;
3°) The avatar contains a reference that discriminate a group of people (ex: nazi cross)&lt;br /&gt;
 | Avatar immediate removal + Devilkin 3 days to devilkin forever depending on the gravity. In any case: the player should be warn that this is the last warning before ban. If the player obviously don&#039;t measure the meaning of the avatar, the penalty can be reduced.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate username&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Username are inappropriate when this is obviously an insult for many people. Moderators shouldn&#039;t moderate a username that is insulting by accident in a language that is not widely used on BGA.&lt;br /&gt;
 | Ban from the website. Moderators should explain that the player is welcome with another username on BGA. Note that if the player has a long seniority on BGA (=many games played), moderators should be very cautious on the case: if no one notice the username until now, it is probably not inappropriate.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Table description&lt;br /&gt;
 | Inappropriate table description&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Table description is inappropriate when it contains insults, insanity, or tend to discriminate a group of people. &lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Kingmaking&lt;br /&gt;
 | Kingmaking action during a game&lt;br /&gt;
 | The report must contains the table id, the exact move number, and the exact explanation why this is a kingmaking action. To declare a player guilty, the player must have played an obvious move against his own interest, and it have to be a good player (clues: his ELO, number of game played, ...). As the difference between a mistake and a kingmaking action is very tight, one kingmaking report is not enough to find a player guilty: only players who regularly play against their interest should be found guilty.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Bug exploit&lt;br /&gt;
 | Exploit a known bug during a game&lt;br /&gt;
 | The bug must have been reported in the forum, and an exact reference to this bug must be in the report, with the table id and the move number. Minor bugs that can be considered as &amp;quot;variants&amp;quot; are NOT concerned (ex: pick 4 cards instead of 3). Bugs that violate the spirit of the game are concerned.&lt;br /&gt;
 | No penalty applies: if there is a bug that has been widely used for a game, a global ELO reset (or an ELO adjustment for players who exploited the bug) will be done. &lt;br /&gt;
 |-&lt;br /&gt;
 ! Private information&lt;br /&gt;
 | Some player gives some private information during the game&lt;br /&gt;
 | Players have the right to pretend things during a game. As these infos could be true or false, and could be exploited by other players too, moderators should be cautious when judging these cases. This case concerns players that had a strong voluntee to kill the pleasure of the game by giving some private information during the game.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Multiple accounts&lt;br /&gt;
 | A player is using multiple accounts (most of the time: to boost his ELO rank)&lt;br /&gt;
 | The report must contains the usernames of all intimidated accounts, and the reason why the report author think that multiple accounts are used. This is very difficult to find out if different accounts corresponds to different person. For example: BGA accepts that multiple players plays from the same IP adress, to allow people from the same family to play at the same table. In addition, some players are using multiple accounts, but these accounts are not playing together (which is acceptable). Strong tools are available for moderators to detect multiple accounts that are used the wrong way.&lt;br /&gt;
 | For secondary accounts: ban forever. For main account: ELO reseted to 1500 / ELO penalty for all games.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Tranlation stealing / vandalism&lt;br /&gt;
 | The player is writing inapropriate / poor quality translations (or writes a lot of very minor modifications to someone else translation) to gain free club membership, &lt;br /&gt;
 | Immediate ban from the website (to avoid vandalism).&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player is slow to play&lt;br /&gt;
 | Players have the right to think as long as they do not go over their alloted time. If the player is slow on purpose, the good answer is: thumb down.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player quit the game before the end&lt;br /&gt;
 | In this case, player automatically gets a ELO penalty + a red mark on his profile. There is no need to do something else.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
&lt;br /&gt;
 |}&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=864</id>
		<title>Moderationpolicy</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=864"/>
		<updated>2013-05-30T18:44:44Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Penalty grid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== General rules ==&lt;br /&gt;
&lt;br /&gt;
=== Beyond a Reasonable Doubt ===&lt;br /&gt;
&lt;br /&gt;
In case there is a any possible doubt, a player should be considered not guilty.&lt;br /&gt;
&lt;br /&gt;
=== Moderators independance ===&lt;br /&gt;
&lt;br /&gt;
Moderators must not process reports if they know the protagonists (author or targeted player). Playing online with the protagonist does not mean to &amp;quot;know&amp;quot; them. &amp;quot;Know&amp;quot; means: know them personally or playing with them online very regularly.&lt;br /&gt;
&lt;br /&gt;
=== Appeal ===&lt;br /&gt;
&lt;br /&gt;
Players has the right to appeal against the moderation decision, by forwarding received moderation email to &amp;quot;contact@boardgamearena.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
They &#039;&#039;&#039;MUST&#039;&#039;&#039; explain in the email why the moderator did not respect the BGA moderation policy. If the explanation is not convincing, the email will be ignored. If the player is obviously guilty and if the moderation policy hasn&#039;t been violated, BGA admins will double the penalties.&lt;br /&gt;
&lt;br /&gt;
=== Penalty grid ===&lt;br /&gt;
&lt;br /&gt;
Moderators should respect the penalties grid as much as possible. However, they have the right to adjust the penalty depending on the gravity of the case. The following situation can lead moderators to increase the penalties:&lt;br /&gt;
* the player has been reported several times for the same type of case.&lt;br /&gt;
* the player wrong action can be obviously qualified by one or several of the following terms: racism, xenophobia, homophobia, sexism, and as a rule of thumb any type of discrimination against a particular category of people.&lt;br /&gt;
* on case there is a provocation, the penalty may be be reduced a little, and the author of the provocation may have a warning BUT, as everyone should keep quiet and polite even if there are provoked, this is a moderator choice.&lt;br /&gt;
&lt;br /&gt;
=== Relapse ===&lt;br /&gt;
&lt;br /&gt;
In case there is a relapse, the penalty increases exponentially.&lt;br /&gt;
&lt;br /&gt;
This is the moderator job to determine the right penalty to apply in this case, considering the fact that the player has been warned by a first penalty.&lt;br /&gt;
&lt;br /&gt;
Moderators should consider there is a relapse only if the new wrong action occurs AFTER the previous penalty has been applied and the associated moderation email has been sent.&lt;br /&gt;
&lt;br /&gt;
Considering it&#039;s a lot of work to analyze reports about players who do the same action again and again, the &amp;quot;ban forever&amp;quot; penalty can be applied to any case if the player relapses.&lt;br /&gt;
&lt;br /&gt;
=== Special urgency ban procedure ===&lt;br /&gt;
&lt;br /&gt;
Whatever the case type, moderators has the right to ban a player from the website (forever) if this player set up a situation that is out of control and must be stopped within hours. This special procedure should only be used if there is an immediate danger for the community (ex: vandalism, flow of insults, massive spam, ...).&lt;br /&gt;
&lt;br /&gt;
=== About private jokes ===&lt;br /&gt;
&lt;br /&gt;
If a wrong action happened in a private circle (ex: at a game table, with no spectators), and if none of the present players reported the action, the moderator must consider this was a &amp;quot;private joke&amp;quot; and must not apply any penalty. In the contrary, if the wrong action is public (ex: post/comment on the wall), the moderator may consider this as a wrong action even if there is no report.&lt;br /&gt;
&lt;br /&gt;
=== Prescription ===&lt;br /&gt;
&lt;br /&gt;
For operational reason, a report that is older than 2 weeks may be closed by moderators because it is too old.&lt;br /&gt;
&lt;br /&gt;
=== Player profile influence ===&lt;br /&gt;
&lt;br /&gt;
The player profile IS taken into account to determine if the player is guilty or not guilty. Moderators gives more credit to players with a good profile than the other.&lt;br /&gt;
&lt;br /&gt;
The player profile is NOT taken into account when choosing the penalty if the player is found guilty.&lt;br /&gt;
&lt;br /&gt;
Good profile elements are:&lt;br /&gt;
* A good thumb up / thumb down ratio.&lt;br /&gt;
* Player is registered since a long time / has a lot of games player.&lt;br /&gt;
* Players is involved in the website (ex: realized translations).&lt;br /&gt;
* Player is supporting BGA (member of the club).&lt;br /&gt;
&lt;br /&gt;
=== Incomplete reports ===&lt;br /&gt;
&lt;br /&gt;
Analyzing reports takes a lot of time, and many reports are received. If any needed information is missing in the report, moderators may (and most of the time, should) close the report.&lt;br /&gt;
&lt;br /&gt;
== Penalty grid ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot;&lt;br /&gt;
|+ Titre&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Category&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Case type&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Details&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Standard penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults during a game, on table chat&lt;br /&gt;
 | Must be present in the report: table ID, and the insults terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on general chat&lt;br /&gt;
 | Must be present in the report: the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 30 days for small insults and insanity, Devilkin forever for real insults. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on public space (wall, forum, comments...)&lt;br /&gt;
 | Must be present in the report: where to find the insult, the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Aggressive attitude&lt;br /&gt;
 | Aggressive attitude during a game: can&#039;t wait the other player, provocation, ...&lt;br /&gt;
 | As a rule of thumb: as long as there is no insult, this is not an issue: thumb down are the solution. BUT, if the player is really borderline and should be warned, a moderation action is needed.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should explain that this is a small warning, and that a change of attitude is needed.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate avatar: porn, extreme violence, advertising...&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Avatar is really inappropriate in 3 cases:&lt;br /&gt;
1°) It can hurt underage players (porn, extreme violence)&lt;br /&gt;
2°) This is advertisement / this violate some intellectual property&lt;br /&gt;
3°) The avatar contains a reference that discriminate a group of people (ex: nazi cross)&lt;br /&gt;
 | Avatar immediate removal + Devilkin 3 days to devilkin forever depending on the gravity. In any case: the player should be warn that this is the last warning before ban. If the player obviously don&#039;t measure the meaning of the avatar, the penalty can be reduced.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate username&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Username are inappropriate when this is obviously an insult for many people. Moderators shouldn&#039;t moderate a username that is insulting by accident in a language that is not widely used on BGA.&lt;br /&gt;
 | Ban from the website. Moderators should explain that the player is welcome with another username on BGA. Note that if the player has a long seniority on BGA (=many games played), moderators should be very cautious on the case: if no one notice the username until now, it is probably not inappropriate.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Table description&lt;br /&gt;
 | Inappropriate table description&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Table description is inappropriate when it contains insults, insanity, or tend to discriminate a group of people. &lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Kingmaking&lt;br /&gt;
 | Kingmaking action during a game&lt;br /&gt;
 | The report must contains the table id, the exact move number, and the exact explanation why this is a kingmaking action. To declare a player guilty, the player must have played an obvious move against his own interest, and it have to be a good player (clues: his ELO, number of game played, ...). As the difference between a mistake and a kingmaking action is very tight, one kingmaking report is not enough to find a player guilty: only players who regularly play against their interest should be found guilty.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Bug exploit&lt;br /&gt;
 | Exploit a known bug during a game&lt;br /&gt;
 | The bug must have been reported in the forum, and an exact reference to this bug must be in the report, with the table id and the move number. Minor bugs that can be considered as &amp;quot;variants&amp;quot; are NOT concerned (ex: pick 4 cards instead of 3). Bugs that violate the spirit of the game are concerned.&lt;br /&gt;
 | No penalty applies: if there is a bug that has been widely used for a game, a global ELO reset (or an ELO adjustment for players who exploited the bug) will be done. &lt;br /&gt;
 |-&lt;br /&gt;
 ! Private information&lt;br /&gt;
 | Some player gives some private information during the game&lt;br /&gt;
 | Players have the right to pretend things during a game. As these infos could be true or false, and could be exploited by other players too, moderators should be cautious when judging these cases. This case concerns players that had a strong voluntee to kill the pleasure of the game by giving some private information during the game.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Multiple accounts&lt;br /&gt;
 | A player is using multiple accounts (most of the time: to boost his ELO rank)&lt;br /&gt;
 | The report must contains the usernames of all intimidated accounts, and the reason why the report author think that multiple accounts are used. This is very difficult to find out if different accounts corresponds to different person. For example: BGA accepts that multiple players plays from the same IP adress, to allow people from the same family to play at the same table. In addition, some players are using multiple accounts, but these accounts are not playing together (which is acceptable). Strong tools are available for moderators to detect multiple accounts that are used the wrong way.&lt;br /&gt;
 | For secondary accounts: ban forever. For main account: ELO reseted to 1500 / ELO penalty for all games.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Tranlation stealing / vandalism&lt;br /&gt;
 | The player is writing inapropriate / poor quality translations (or writes a lot of very minor modifications to someone else translation) to gain free club membership, &lt;br /&gt;
 | Immediate ban from the website (to avoid vandalism).&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player is slow to play&lt;br /&gt;
 | Players have the right to think as long as they do not go over their alloted time. If the player is slow on purpose, the good answer is: thumb down.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player quit the game before the end&lt;br /&gt;
 | In this case, player automatically gets a ELO penalty + a red mark on his profile. There is no need to do something else.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
&lt;br /&gt;
 |}&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=863</id>
		<title>Moderationpolicy</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=863"/>
		<updated>2013-05-30T18:44:30Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Penalty grid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== General rules ==&lt;br /&gt;
&lt;br /&gt;
=== Beyond a Reasonable Doubt ===&lt;br /&gt;
&lt;br /&gt;
In case there is a any possible doubt, a player should be considered not guilty.&lt;br /&gt;
&lt;br /&gt;
=== Moderators independance ===&lt;br /&gt;
&lt;br /&gt;
Moderators must not process reports if they know the protagonists (author or targeted player). Playing online with the protagonist does not mean to &amp;quot;know&amp;quot; them. &amp;quot;Know&amp;quot; means: know them personally or playing with them online very regularly.&lt;br /&gt;
&lt;br /&gt;
=== Appeal ===&lt;br /&gt;
&lt;br /&gt;
Players has the right to appeal against the moderation decision, by forwarding received moderation email to &amp;quot;contact@boardgamearena.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
They &#039;&#039;&#039;MUST&#039;&#039;&#039; explain in the email why the moderator did not respect the BGA moderation policy. If the explanation is not convincing, the email will be ignored. If the player is obviously guilty and if the moderation policy hasn&#039;t been violated, BGA admins will double the penalties.&lt;br /&gt;
&lt;br /&gt;
=== Penalty grid ===&lt;br /&gt;
&lt;br /&gt;
Moderators should respect the penalties grid as much as possible. However, they have the right to adjust the penalty depending on the gravity of the case. The following situation can lead moderators to increase the penalties:&lt;br /&gt;
* the player has been reported several time for the same type of case.&lt;br /&gt;
* the player wrong action can be obviously qualified by one or several of the following terms: racism, xenophobia, homophobia, sexism, and as a rule of thumb any type of discrimination against a particular category of people.&lt;br /&gt;
* on case there is a provocation, the penalty may be be reduced a little, and the author of the provocation may have a warning BUT, as everyone should keep quiet and polite even if there are provoked, this is a moderator choice.&lt;br /&gt;
&lt;br /&gt;
=== Relapse ===&lt;br /&gt;
&lt;br /&gt;
In case there is a relapse, the penalty increases exponentially.&lt;br /&gt;
&lt;br /&gt;
This is the moderator job to determine the right penalty to apply in this case, considering the fact that the player has been warned by a first penalty.&lt;br /&gt;
&lt;br /&gt;
Moderators should consider there is a relapse only if the new wrong action occurs AFTER the previous penalty has been applied and the associated moderation email has been sent.&lt;br /&gt;
&lt;br /&gt;
Considering it&#039;s a lot of work to analyze reports about players who do the same action again and again, the &amp;quot;ban forever&amp;quot; penalty can be applied to any case if the player relapses.&lt;br /&gt;
&lt;br /&gt;
=== Special urgency ban procedure ===&lt;br /&gt;
&lt;br /&gt;
Whatever the case type, moderators has the right to ban a player from the website (forever) if this player set up a situation that is out of control and must be stopped within hours. This special procedure should only be used if there is an immediate danger for the community (ex: vandalism, flow of insults, massive spam, ...).&lt;br /&gt;
&lt;br /&gt;
=== About private jokes ===&lt;br /&gt;
&lt;br /&gt;
If a wrong action happened in a private circle (ex: at a game table, with no spectators), and if none of the present players reported the action, the moderator must consider this was a &amp;quot;private joke&amp;quot; and must not apply any penalty. In the contrary, if the wrong action is public (ex: post/comment on the wall), the moderator may consider this as a wrong action even if there is no report.&lt;br /&gt;
&lt;br /&gt;
=== Prescription ===&lt;br /&gt;
&lt;br /&gt;
For operational reason, a report that is older than 2 weeks may be closed by moderators because it is too old.&lt;br /&gt;
&lt;br /&gt;
=== Player profile influence ===&lt;br /&gt;
&lt;br /&gt;
The player profile IS taken into account to determine if the player is guilty or not guilty. Moderators gives more credit to players with a good profile than the other.&lt;br /&gt;
&lt;br /&gt;
The player profile is NOT taken into account when choosing the penalty if the player is found guilty.&lt;br /&gt;
&lt;br /&gt;
Good profile elements are:&lt;br /&gt;
* A good thumb up / thumb down ratio.&lt;br /&gt;
* Player is registered since a long time / has a lot of games player.&lt;br /&gt;
* Players is involved in the website (ex: realized translations).&lt;br /&gt;
* Player is supporting BGA (member of the club).&lt;br /&gt;
&lt;br /&gt;
=== Incomplete reports ===&lt;br /&gt;
&lt;br /&gt;
Analyzing reports takes a lot of time, and many reports are received. If any needed information is missing in the report, moderators may (and most of the time, should) close the report.&lt;br /&gt;
&lt;br /&gt;
== Penalty grid ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot;&lt;br /&gt;
|+ Titre&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Category&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Case type&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Details&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Standard penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults during a game, on table chat&lt;br /&gt;
 | Must be present in the report: table ID, and the insults terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on general chat&lt;br /&gt;
 | Must be present in the report: the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 30 days for small insults and insanity, Devilkin forever for real insults. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on public space (wall, forum, comments...)&lt;br /&gt;
 | Must be present in the report: where to find the insult, the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Aggressive attitude&lt;br /&gt;
 | Aggressive attitude during a game: can&#039;t wait the other player, provocation, ...&lt;br /&gt;
 | As a rule of thumb: as long as there is no insult, this is not an issue: thumb down are the solution. BUT, if the player is really borderline and should be warned, a moderation action is needed.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should explain that this is a small warning, and that a change of attitude is needed.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate avatar: porn, extreme violence, advertising...&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Avatar is really inappropriate in 3 cases:&lt;br /&gt;
1°) It can hurt underage players (porn, extreme violence)&lt;br /&gt;
2°) This is advertisement / this violate some intellectual property&lt;br /&gt;
3°) The avatar contains a reference that discriminate a group of people (ex: nazi cross)&lt;br /&gt;
 | Avatar immediate removal + Devilkin 3 days to devilkin forever depending on the gravity. In any case: the player should be warn that this is the last warning before ban. If the player obviously don&#039;t measure the meaning of the avatar, the penalty can be reduced.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate username&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Username are inappropriate when this is obviously an insult for many people. Moderators shouldn&#039;t moderate a username that is insulting by accident in a language that is not widely used on BGA.&lt;br /&gt;
 | Ban from the website. Moderators should explain that the player is welcome with another username on BGA. Note that if the player has a long seniority on BGA (=many games played), moderators should be very cautious on the case: if no one notice the username until now, it is probably not inappropriate.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Table description&lt;br /&gt;
 | Inappropriate table description&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Table description is inappropriate when it contains insults, insanity, or tend to discriminate a group of people. &lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Kingmaking&lt;br /&gt;
 | Kingmaking action during a game&lt;br /&gt;
 | The report must contains the table id, the exact move number, and the exact explanation why this is a kingmaking action. To declare a player guilty, the player must have played an obvious move against his own interest, and it have to be a good player (clues: his ELO, number of game played, ...). As the difference between a mistake and a kingmaking action is very tight, one kingmaking report is not enough to find a player guilty: only players who regularly play against their interest should be found guilty.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Bug exploit&lt;br /&gt;
 | Exploit a known bug during a game&lt;br /&gt;
 | The bug must have been reported in the forum, and an exact reference to this bug must be in the report, with the table id and the move number. Minor bugs that can be considered as &amp;quot;variants&amp;quot; are NOT concerned (ex: pick 4 cards instead of 3). Bugs that violate the spirit of the game are concerned.&lt;br /&gt;
 | No penalty applies: if there is a bug that has been widely used for a game, a global ELO reset (or an ELO adjustment for players who exploited the bug) will be done. &lt;br /&gt;
 |-&lt;br /&gt;
 ! Private information&lt;br /&gt;
 | Some player gives some private information during the game&lt;br /&gt;
 | Players have the right to pretend things during a game. As these infos could be true or false, and could be exploited by other players too, moderators should be cautious when judging these cases. This case concerns players that had a strong voluntee to kill the pleasure of the game by giving some private information during the game.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Multiple accounts&lt;br /&gt;
 | A player is using multiple accounts (most of the time: to boost his ELO rank)&lt;br /&gt;
 | The report must contains the usernames of all intimidated accounts, and the reason why the report author think that multiple accounts are used. This is very difficult to find out if different accounts corresponds to different person. For example: BGA accepts that multiple players plays from the same IP adress, to allow people from the same family to play at the same table. In addition, some players are using multiple accounts, but these accounts are not playing together (which is acceptable). Strong tools are available for moderators to detect multiple accounts that are used the wrong way.&lt;br /&gt;
 | For secondary accounts: ban forever. For main account: ELO reseted to 1500 / ELO penalty for all games.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Tranlation stealing / vandalism&lt;br /&gt;
 | The player is writing inapropriate / poor quality translations (or writes a lot of very minor modifications to someone else translation) to gain free club membership, &lt;br /&gt;
 | Immediate ban from the website (to avoid vandalism).&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player is slow to play&lt;br /&gt;
 | Players have the right to think as long as they do not go over their alloted time. If the player is slow on purpose, the good answer is: thumb down.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player quit the game before the end&lt;br /&gt;
 | In this case, player automatically gets a ELO penalty + a red mark on his profile. There is no need to do something else.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
&lt;br /&gt;
 |}&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Practical_debugging&amp;diff=829</id>
		<title>Practical debugging</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Practical_debugging&amp;diff=829"/>
		<updated>2013-05-19T20:14:01Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Add traces to your code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This page gives you practical tips to debug your game during the development. Don&#039;t hesitate to share with us your difficulties in order we can improve this section.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
To work on BGA Studio, we recommend you to use [www.google.com/chrome Google Chrome] as it&#039;s the current fastest browser for BGA platform, and it&#039;s available in all OS.&lt;br /&gt;
&lt;br /&gt;
Another reason to use Chrome is that it embed all tools you need to work on BGA Studio. You can see them by pressing &amp;quot;F12&amp;quot; or from the menu (&amp;quot;Tools &amp;gt; Development tools&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
A good practice is to use a second browser to develop the game, in order to check that your game is working fine on this browser too.&lt;br /&gt;
&lt;br /&gt;
To debug with Firefox browser, we advise you to use these 2 extensions:&lt;br /&gt;
* [https://addons.mozilla.org/firefox/addon/firebug/ Firebug]&lt;br /&gt;
* [https://addons.mozilla.org/firefox/addon/web-developer/ Web developper]&lt;br /&gt;
&lt;br /&gt;
To debug with Internet Explorer, we advise you to use one of the most recent version (ex: IE9). Last versions of Internet Explorer have way better development tools than the previous ones...&lt;br /&gt;
&lt;br /&gt;
== General tip for debugging ==&lt;br /&gt;
&lt;br /&gt;
In general for debugging, think of using the &#039;[[Tools_and_tips_of_BGA_Studio#Save_.26_restore_state|save &amp;amp; restore]] state&#039; functionality. It enables you to save the state of your game just before the issue you are investigating, then come back to that point with one click as many times as needed to understand what is going wrong.&lt;br /&gt;
&lt;br /&gt;
You can save up to 3 different states.&lt;br /&gt;
&lt;br /&gt;
== Debugging my game when it cannot start ==&lt;br /&gt;
&lt;br /&gt;
If your game don&#039;t start because of an error, you are probably in one of these situations:&lt;br /&gt;
* There is a SQL error in your dbmodel.sql file.&lt;br /&gt;
* You have a syntax error in your PHP file.&lt;br /&gt;
* Your PHP &amp;quot;setup&amp;quot; - or any method used during the game initial states - generates an exception.&lt;br /&gt;
&lt;br /&gt;
If the error is not explicitly displayed when you click on &amp;quot;Express start&amp;quot;, you should check the &amp;quot;Gameserver error log&amp;quot; in the [[Studio_back-office|Studio backoffice]].&lt;br /&gt;
&lt;br /&gt;
== Debugging my PHP game logic (or my view) ==&lt;br /&gt;
&lt;br /&gt;
Most of the time, debugging PHP is quite easy. Here&#039;s what I do when I want to develop/debug some game logic that is triggered by some game action:&lt;br /&gt;
&lt;br /&gt;
* At first, I make sure that I can reproduce the needed game situation in one click. To do this, I use the &amp;quot;[[Tools_and_tips_of_BGA_Studio#Save_.26_restore_state|save &amp;amp; restore]]&amp;quot; function.&lt;br /&gt;
* Another possibility for this is to place a &#039;&#039;&#039;die(&#039;ok&#039;);&#039;&#039;&#039; PHP statement right after the PHP I am developing/debugging. This way, I make sure that every request will fail and then nothing will be commited to the database, anyway.&lt;br /&gt;
* Then, I use &#039;&#039;&#039;var_dump&#039;&#039;&#039; function to dump PHP variables and check what&#039;s wrong, until it works.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// (...my code to debug)&lt;br /&gt;
&lt;br /&gt;
var_dump( $my_variable );&lt;br /&gt;
die(&#039;ok&#039;);&lt;br /&gt;
&lt;br /&gt;
// (...my code to debug)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add traces to your code ===&lt;br /&gt;
&lt;br /&gt;
You can use the following functions in your game to add server side logging:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;self::debug( $message );&#039;&#039;&#039;  // debug level logging&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;self::trace( $message );&#039;&#039;&#039;  // info level logging&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;self::warn( $message );&#039;&#039;&#039;   // warning level logging&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;self::error( $message );&#039;&#039;&#039;  // error level logging&lt;br /&gt;
&lt;br /&gt;
To see the logs, you should check the &amp;quot;Current table error log&amp;quot; in the [[Studio_back-office|Studio backoffice]].&lt;br /&gt;
&lt;br /&gt;
This can be useful when you need to follow the flow of your code and not just stop it to see how it goes at some point.&lt;br /&gt;
&lt;br /&gt;
Only the error log level will appear in production. This level should be used only for critical problems. &lt;br /&gt;
Other levels will show only in the development environment and can be used as you see fit.&lt;br /&gt;
&lt;br /&gt;
== Debugging my HTML/CSS layout ==&lt;br /&gt;
&lt;br /&gt;
Situation examples:&lt;br /&gt;
* why my game element doesn&#039;t show up in the interface?&lt;br /&gt;
* why my CSS property hasn&#039;t been applied to this element?&lt;br /&gt;
* why this game element is displayed at this position?&lt;br /&gt;
&lt;br /&gt;
A first useful tip when an element does not show up in the interface is to give it a red background:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#my_element {&lt;br /&gt;
  ... some CSS definitions ...&lt;br /&gt;
  background-color: red;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way, you know if the element is not visible because of some of its CSS property or because of anything else.&lt;br /&gt;
&lt;br /&gt;
Another tip: sometimes, you change a CSS property with no visible effect on your interface. In that case, add a &amp;quot;display:none&amp;quot; property. If your element does not disappear, the bug probably comes from your CSS selector and not from your CSS property.&lt;br /&gt;
&lt;br /&gt;
Using Chrome &amp;quot;Elements&amp;quot; tab (thre first one), you can:&lt;br /&gt;
* See the CURRENT HTML of your page. Remember that the classical &amp;quot;show page source&amp;quot; is inefficient with BGA as you are modifying the page source with your Javascript code.&lt;br /&gt;
* Using the &amp;quot;magnifying glass&amp;quot;, you can click on any part of your game interface and check it&#039;s HTML code and associated CSS styles.&lt;br /&gt;
* You can even modify directly some CSS property and see if how it looks immediately on the game interface.&lt;br /&gt;
&lt;br /&gt;
== Debugging my Javascript game interface logic ==&lt;br /&gt;
&lt;br /&gt;
Compare to PHP debugging, Javascript debugging can sometimes be painful.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s are some tips to make your life easier while developing and debugging Javascript:&lt;br /&gt;
&lt;br /&gt;
=== Do complex things on PHP side ===&lt;br /&gt;
&lt;br /&gt;
PHP side is more reliable and simpler to debug than Javascript. Then, when you need to perform a complex operation, check first it you can&#039;t write it on server side first.&lt;br /&gt;
&lt;br /&gt;
The most frequent case is the following: you want to compute possible moves in a game situation. Doing it in Javascript is a nightmare. Then, do it on PHP, and transfer the result to your client interface using the &amp;quot;args&amp;quot; game state property.&lt;br /&gt;
&lt;br /&gt;
Note: check Reversi example for this.&lt;br /&gt;
&lt;br /&gt;
=== Add traces in your code ===&lt;br /&gt;
&lt;br /&gt;
You can use the following:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;console.log( variable_to_inspect )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It will give you the object structure of the variable in the Javascript console, without blocking the execution.&lt;br /&gt;
&lt;br /&gt;
It&#039;s often a good idea to precede this call with a console.log( &#039;### HERE ###&#039; ); to find more easily the appropriate line in the console log.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;alert( variable_to_inspect )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It will popup what you wish and pause the execution until you click ok.&lt;br /&gt;
&lt;br /&gt;
This won&#039;t be useful for complex structures, only native types will get plainly displayed. But this is sometimes useful just with messages to make sure which way the execution goes.&lt;br /&gt;
&lt;br /&gt;
== Some frequent errors ==&lt;br /&gt;
&lt;br /&gt;
=== when launching the game &amp;quot;Fatal error during creation of database ebd_quoridor_389 Not logged.&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
Check that you didn&#039;t use $g_user or getCurrentPlayerId() in setupNewGame() function or in an &amp;quot;args&amp;quot; function of your state.&lt;br /&gt;
&lt;br /&gt;
As these functions are not consequences of a user action, there is no current player defined.&lt;br /&gt;
&lt;br /&gt;
As a general rule, you should use getActivePlayerId() and not getCurrentPlayerId(). See the [http://www.slideshare.net/boardgamearena/bga-studio-focus-on-bga-game-state-machine presentation on the game state machine] for more information.&lt;br /&gt;
&lt;br /&gt;
=== when refreshing the web page, the interface remains on &amp;quot;Application loading...&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
In this case, you probably have a syntax error in your Javascript code, and the interface refuses to load.&lt;br /&gt;
&lt;br /&gt;
To find this error, check if there is an error message in the Javascript console (F12).&lt;br /&gt;
&lt;br /&gt;
If there is really nothing on the log, it&#039;s probably that the system was unable to load your Javascript because of an syntax error that affect the structure of the Javascript file, typically a missing &amp;quot;}&amp;quot; or a missing &amp;quot;,&amp;quot; after a method definition.&lt;br /&gt;
&lt;br /&gt;
=== When I do a move, I got &amp;quot;Move recorded, waiting for update ...&amp;quot; forever ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Move recorded&amp;quot; means that your ajaxcall request has been sent to the server and returned normally.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Waiting for update&amp;quot; means that your client interface is waiting for some notifications from the server that correspond to the move we just did.&lt;br /&gt;
&lt;br /&gt;
If this message stays forever, it is probably that your PHP code does not send any notification when the move happens, which is abnormal. To fix this: add a notifyAllPlayers or a notifyPlayer call in your PHP code.&lt;br /&gt;
&lt;br /&gt;
=== Some player action is triggered randomly when I click somewhere on the game area ===&lt;br /&gt;
&lt;br /&gt;
You probably used &amp;quot;dojo.connect&amp;quot; on a null object. In this case, dojo.connect associate the event (ex: &amp;quot;onclick&amp;quot;) to the whole game area.&lt;br /&gt;
&lt;br /&gt;
Most of the time it happens in this situation, when my_object element does not exists:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   dojo.connect( $(&amp;quot;my_object&amp;quot;), &amp;quot;onclick&amp;quot;, this, function() {&lt;br /&gt;
     ...&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To determine if this is the case, place &amp;quot;alert( $(&amp;quot;my_object&amp;quot;) )&amp;quot; before the dojo.connect to check if the object exists or not.&lt;br /&gt;
&lt;br /&gt;
=== Javascript does not know how to sum two numbers ===&lt;br /&gt;
&lt;br /&gt;
Be careful when you manipulate integers returned by notifications: most of the time, Javascript considers they are Strings and not Integers.&lt;br /&gt;
&lt;br /&gt;
As a result:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    var i=1;&lt;br /&gt;
    i += notif.args.increment;  // With notif.args.increment=&#039;1&#039;&lt;br /&gt;
    alert( i );                 // i=11 instead of 2 !! Javascript concatenate 2 strings !&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To solve this, you should use the &amp;quot;toint&amp;quot; function:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    var i=1;&lt;br /&gt;
    i += toint( notif.args.increment );  // With notif.args.increment=&#039;1&#039;&lt;br /&gt;
    alert( i );                 // i=2 :)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Javascript: do not use substr with negative numbers ===&lt;br /&gt;
&lt;br /&gt;
To get the last characters of a string, use &amp;quot;slice&amp;quot; instead of &amp;quot;substr&amp;quot; which has a bug on IE:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    var three_last_characters = string.substr( -3 );   // Wrong&lt;br /&gt;
    var three_last_characters = string.slice( -3 );    // Correct&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Practical_debugging&amp;diff=828</id>
		<title>Practical debugging</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Practical_debugging&amp;diff=828"/>
		<updated>2013-05-19T19:32:34Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Debugging my PHP game logic (or my view) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This page gives you practical tips to debug your game during the development. Don&#039;t hesitate to share with us your difficulties in order we can improve this section.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
To work on BGA Studio, we recommend you to use [www.google.com/chrome Google Chrome] as it&#039;s the current fastest browser for BGA platform, and it&#039;s available in all OS.&lt;br /&gt;
&lt;br /&gt;
Another reason to use Chrome is that it embed all tools you need to work on BGA Studio. You can see them by pressing &amp;quot;F12&amp;quot; or from the menu (&amp;quot;Tools &amp;gt; Development tools&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
A good practice is to use a second browser to develop the game, in order to check that your game is working fine on this browser too.&lt;br /&gt;
&lt;br /&gt;
To debug with Firefox browser, we advise you to use these 2 extensions:&lt;br /&gt;
* [https://addons.mozilla.org/firefox/addon/firebug/ Firebug]&lt;br /&gt;
* [https://addons.mozilla.org/firefox/addon/web-developer/ Web developper]&lt;br /&gt;
&lt;br /&gt;
To debug with Internet Explorer, we advise you to use one of the most recent version (ex: IE9). Last versions of Internet Explorer have way better development tools than the previous ones...&lt;br /&gt;
&lt;br /&gt;
== General tip for debugging ==&lt;br /&gt;
&lt;br /&gt;
In general for debugging, think of using the &#039;[[Tools_and_tips_of_BGA_Studio#Save_.26_restore_state|save &amp;amp; restore]] state&#039; functionality. It enables you to save the state of your game just before the issue you are investigating, then come back to that point with one click as many times as needed to understand what is going wrong.&lt;br /&gt;
&lt;br /&gt;
You can save up to 3 different states.&lt;br /&gt;
&lt;br /&gt;
== Debugging my game when it cannot start ==&lt;br /&gt;
&lt;br /&gt;
If your game don&#039;t start because of an error, you are probably in one of these situations:&lt;br /&gt;
* There is a SQL error in your dbmodel.sql file.&lt;br /&gt;
* You have a syntax error in your PHP file.&lt;br /&gt;
* Your PHP &amp;quot;setup&amp;quot; - or any method used during the game initial states - generates an exception.&lt;br /&gt;
&lt;br /&gt;
If the error is not explicitly displayed when you click on &amp;quot;Express start&amp;quot;, you should check the &amp;quot;Gameserver error log&amp;quot; in the [[Studio_back-office|Studio backoffice]].&lt;br /&gt;
&lt;br /&gt;
== Debugging my PHP game logic (or my view) ==&lt;br /&gt;
&lt;br /&gt;
Most of the time, debugging PHP is quite easy. Here&#039;s what I do when I want to develop/debug some game logic that is triggered by some game action:&lt;br /&gt;
&lt;br /&gt;
* At first, I make sure that I can reproduce the needed game situation in one click. To do this, I use the &amp;quot;[[Tools_and_tips_of_BGA_Studio#Save_.26_restore_state|save &amp;amp; restore]]&amp;quot; function.&lt;br /&gt;
* Another possibility for this is to place a &#039;&#039;&#039;die(&#039;ok&#039;);&#039;&#039;&#039; PHP statement right after the PHP I am developing/debugging. This way, I make sure that every request will fail and then nothing will be commited to the database, anyway.&lt;br /&gt;
* Then, I use &#039;&#039;&#039;var_dump&#039;&#039;&#039; function to dump PHP variables and check what&#039;s wrong, until it works.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// (...my code to debug)&lt;br /&gt;
&lt;br /&gt;
var_dump( $my_variable );&lt;br /&gt;
die(&#039;ok&#039;);&lt;br /&gt;
&lt;br /&gt;
// (...my code to debug)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add traces to your code ===&lt;br /&gt;
&lt;br /&gt;
You can use the following functions in your game to add server side logging:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;self::debug( $message )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;self::trace( $message )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;self::warn( $message )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;self::error( $message )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To see the logs, you should check the &amp;quot;Current table error log&amp;quot; in the [[Studio_back-office|Studio backoffice]].&lt;br /&gt;
&lt;br /&gt;
This can be useful when you need to follow the flow of your code and not just stop it to see how it goes at some point.&lt;br /&gt;
&lt;br /&gt;
Only the error log level will appear in production. This level should be used only for critical problems. &lt;br /&gt;
Other levels will show only in the development environment and can be used as you see fit.&lt;br /&gt;
&lt;br /&gt;
== Debugging my HTML/CSS layout ==&lt;br /&gt;
&lt;br /&gt;
Situation examples:&lt;br /&gt;
* why my game element doesn&#039;t show up in the interface?&lt;br /&gt;
* why my CSS property hasn&#039;t been applied to this element?&lt;br /&gt;
* why this game element is displayed at this position?&lt;br /&gt;
&lt;br /&gt;
A first useful tip when an element does not show up in the interface is to give it a red background:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#my_element {&lt;br /&gt;
  ... some CSS definitions ...&lt;br /&gt;
  background-color: red;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way, you know if the element is not visible because of some of its CSS property or because of anything else.&lt;br /&gt;
&lt;br /&gt;
Another tip: sometimes, you change a CSS property with no visible effect on your interface. In that case, add a &amp;quot;display:none&amp;quot; property. If your element does not disappear, the bug probably comes from your CSS selector and not from your CSS property.&lt;br /&gt;
&lt;br /&gt;
Using Chrome &amp;quot;Elements&amp;quot; tab (thre first one), you can:&lt;br /&gt;
* See the CURRENT HTML of your page. Remember that the classical &amp;quot;show page source&amp;quot; is inefficient with BGA as you are modifying the page source with your Javascript code.&lt;br /&gt;
* Using the &amp;quot;magnifying glass&amp;quot;, you can click on any part of your game interface and check it&#039;s HTML code and associated CSS styles.&lt;br /&gt;
* You can even modify directly some CSS property and see if how it looks immediately on the game interface.&lt;br /&gt;
&lt;br /&gt;
== Debugging my Javascript game interface logic ==&lt;br /&gt;
&lt;br /&gt;
Compare to PHP debugging, Javascript debugging can sometimes be painful.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s are some tips to make your life easier while developing and debugging Javascript:&lt;br /&gt;
&lt;br /&gt;
=== Do complex things on PHP side ===&lt;br /&gt;
&lt;br /&gt;
PHP side is more reliable and simpler to debug than Javascript. Then, when you need to perform a complex operation, check first it you can&#039;t write it on server side first.&lt;br /&gt;
&lt;br /&gt;
The most frequent case is the following: you want to compute possible moves in a game situation. Doing it in Javascript is a nightmare. Then, do it on PHP, and transfer the result to your client interface using the &amp;quot;args&amp;quot; game state property.&lt;br /&gt;
&lt;br /&gt;
Note: check Reversi example for this.&lt;br /&gt;
&lt;br /&gt;
=== Add traces in your code ===&lt;br /&gt;
&lt;br /&gt;
You can use the following:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;console.log( variable_to_inspect )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It will give you the object structure of the variable in the Javascript console, without blocking the execution.&lt;br /&gt;
&lt;br /&gt;
It&#039;s often a good idea to precede this call with a console.log( &#039;### HERE ###&#039; ); to find more easily the appropriate line in the console log.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;alert( variable_to_inspect )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It will popup what you wish and pause the execution until you click ok.&lt;br /&gt;
&lt;br /&gt;
This won&#039;t be useful for complex structures, only native types will get plainly displayed. But this is sometimes useful just with messages to make sure which way the execution goes.&lt;br /&gt;
&lt;br /&gt;
== Some frequent errors ==&lt;br /&gt;
&lt;br /&gt;
=== when launching the game &amp;quot;Fatal error during creation of database ebd_quoridor_389 Not logged.&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
Check that you didn&#039;t use $g_user or getCurrentPlayerId() in setupNewGame() function or in an &amp;quot;args&amp;quot; function of your state.&lt;br /&gt;
&lt;br /&gt;
As these functions are not consequences of a user action, there is no current player defined.&lt;br /&gt;
&lt;br /&gt;
As a general rule, you should use getActivePlayerId() and not getCurrentPlayerId(). See the [http://www.slideshare.net/boardgamearena/bga-studio-focus-on-bga-game-state-machine presentation on the game state machine] for more information.&lt;br /&gt;
&lt;br /&gt;
=== when refreshing the web page, the interface remains on &amp;quot;Application loading...&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
In this case, you probably have a syntax error in your Javascript code, and the interface refuses to load.&lt;br /&gt;
&lt;br /&gt;
To find this error, check if there is an error message in the Javascript console (F12).&lt;br /&gt;
&lt;br /&gt;
If there is really nothing on the log, it&#039;s probably that the system was unable to load your Javascript because of an syntax error that affect the structure of the Javascript file, typically a missing &amp;quot;}&amp;quot; or a missing &amp;quot;,&amp;quot; after a method definition.&lt;br /&gt;
&lt;br /&gt;
=== When I do a move, I got &amp;quot;Move recorded, waiting for update ...&amp;quot; forever ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Move recorded&amp;quot; means that your ajaxcall request has been sent to the server and returned normally.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Waiting for update&amp;quot; means that your client interface is waiting for some notifications from the server that correspond to the move we just did.&lt;br /&gt;
&lt;br /&gt;
If this message stays forever, it is probably that your PHP code does not send any notification when the move happens, which is abnormal. To fix this: add a notifyAllPlayers or a notifyPlayer call in your PHP code.&lt;br /&gt;
&lt;br /&gt;
=== Some player action is triggered randomly when I click somewhere on the game area ===&lt;br /&gt;
&lt;br /&gt;
You probably used &amp;quot;dojo.connect&amp;quot; on a null object. In this case, dojo.connect associate the event (ex: &amp;quot;onclick&amp;quot;) to the whole game area.&lt;br /&gt;
&lt;br /&gt;
Most of the time it happens in this situation, when my_object element does not exists:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   dojo.connect( $(&amp;quot;my_object&amp;quot;), &amp;quot;onclick&amp;quot;, this, function() {&lt;br /&gt;
     ...&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To determine if this is the case, place &amp;quot;alert( $(&amp;quot;my_object&amp;quot;) )&amp;quot; before the dojo.connect to check if the object exists or not.&lt;br /&gt;
&lt;br /&gt;
=== Javascript does not know how to sum two numbers ===&lt;br /&gt;
&lt;br /&gt;
Be careful when you manipulate integers returned by notifications: most of the time, Javascript considers they are Strings and not Integers.&lt;br /&gt;
&lt;br /&gt;
As a result:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    var i=1;&lt;br /&gt;
    i += notif.args.increment;  // With notif.args.increment=&#039;1&#039;&lt;br /&gt;
    alert( i );                 // i=11 instead of 2 !! Javascript concatenate 2 strings !&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To solve this, you should use the &amp;quot;toint&amp;quot; function:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    var i=1;&lt;br /&gt;
    i += toint( notif.args.increment );  // With notif.args.increment=&#039;1&#039;&lt;br /&gt;
    alert( i );                 // i=2 :)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Javascript: do not use substr with negative numbers ===&lt;br /&gt;
&lt;br /&gt;
To get the last characters of a string, use &amp;quot;slice&amp;quot; instead of &amp;quot;substr&amp;quot; which has a bug on IE:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    var three_last_characters = string.substr( -3 );   // Wrong&lt;br /&gt;
    var three_last_characters = string.slice( -3 );    // Correct&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Translations&amp;diff=810</id>
		<title>Translations</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Translations&amp;diff=810"/>
		<updated>2013-05-10T19:54:03Z</updated>

		<summary type="html">&lt;p&gt;Een: /* On client side (Javascript) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Using BGA Studio, the game you create is ready to be translated to each language by the BGA community. To make this possible, you only need to specify which string must be translated and how to combine them.&lt;br /&gt;
&lt;br /&gt;
== How translation works? ==&lt;br /&gt;
&lt;br /&gt;
When developing your game, all strings must be in English. Strings must be coherent with the English version of the game.&lt;br /&gt;
&lt;br /&gt;
Before the release of the game, BGA team will do the French translation of the game.&lt;br /&gt;
&lt;br /&gt;
After the release of the game, the BGA players community will translate the game in every language.&lt;br /&gt;
&lt;br /&gt;
== What should be translated? ==&lt;br /&gt;
&lt;br /&gt;
Every text that can be visible by the player when the game is running normally. This includes tooltips, texts on cards, error messages, ...&lt;br /&gt;
&lt;br /&gt;
This does NOT include error messages that are not supposed to happened (unexpected errors).&lt;br /&gt;
&lt;br /&gt;
== Focus on translating notifications ==&lt;br /&gt;
&lt;br /&gt;
Usually, translating a website is simple: you just call a function on every string you have to translate, and the string is translated in the player&#039;s language. On Board Game Arena, this is exactly the same with the &amp;quot;_( string )&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
However, there is one difference on BGA: notifications. The server is sending notifications to players, and most of the time the notifications are the same for every players, no matter what language each player is using. This is why notifications are translated on client side in the proper language, even if the strings are defined on server side.&lt;br /&gt;
&lt;br /&gt;
== WARNING: how to make sure your strings will be translated ==&lt;br /&gt;
&lt;br /&gt;
For each game, our translation tool is doing a full scan of the code, looking for translator markers like &amp;quot;_()&amp;quot; or &amp;quot;clientranslate()&amp;quot;... (see below the list of translation markers).&lt;br /&gt;
&lt;br /&gt;
If your original string is not &amp;quot;physically&amp;quot; inside one of this marker, it won&#039;t be translated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Examples: the following strings will be translated:&lt;br /&gt;
    var mystring_translated = _(&amp;quot;my string&amp;quot;);       // JS&lt;br /&gt;
    $mystring_translated = self::_(&amp;quot;my string&amp;quot;);    // PHP&lt;br /&gt;
    $mystring_translated = sprintf( _(&amp;quot;my string with an %s argument&amp;quot;), $argument );   // PHP&lt;br /&gt;
&lt;br /&gt;
    // Examples: the following strings WILL NOT be translated:&lt;br /&gt;
    $my_string = &amp;quot;my string&amp;quot;;&lt;br /&gt;
    $not_translated = self::_( $my_string );   // The original string is not bordered by a translator marker =&amp;gt; no translation&lt;br /&gt;
    $not_translated = self::_( sprintf( &amp;quot;my string with a %s argument&amp;quot;, $argument ) ); // Same thing&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to not make translators crazy ;) ==&lt;br /&gt;
&lt;br /&gt;
* When you need the same string twice, try to reuse exactly the same string (with the same case) to minimize the number of strings.&lt;br /&gt;
* Do not mark as translatable a game element that does not have to be translated (ex: if the name of a monster on a card is &amp;quot;Zzzzz&amp;quot;, maybe there&#039;s no need to translate it).&lt;br /&gt;
* Words does not come in the same order in each language. Thus, when you have to translate a string with an argument, do not write something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;_(&amp;quot;First part of the string, &amp;quot;).$argument.&#039; &#039;._(&amp;quot;second part of the string&amp;quot;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
Write instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;sprintf( _(&amp;quot;First part of the string, %s second part of the string&amp;quot;), $argument )&amp;lt;/pre&amp;gt;&lt;br /&gt;
(or the equivalent &amp;quot;dojo.string.substitute&amp;quot; in Javascript)&lt;br /&gt;
* When translators are going to translate your game, the most difficult task for them is to get the context of the string to be translated. The more the string is a short insignificant string, the more difficult is the task for them. As a rule of thumb, try to avoid insignificant short strings.&lt;br /&gt;
* The BGA translation policy is to be flexible on grammar... We prefer to write &amp;quot;player gets 1 coin(s)&amp;quot; than write two versions of the same string for plural and singular - it reduces the number of strings to translate.&lt;br /&gt;
* Instead of writing nice strings like &amp;quot;With the effect of ZZZ, player XXX gets a new YYY&amp;quot;, which is very difficult to translate, write strings like &amp;quot;ZZZ: XXX gets YYY&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== On client side (Javascript) ==&lt;br /&gt;
&lt;br /&gt;
On client side, things are quite simple: you just have to use the &amp;quot;_()&amp;quot; function for all strings you want to translate.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Get a string in player&#039;s language:&lt;br /&gt;
var translated = _(&amp;quot;original english string&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Get a string in player&#039;s language with parameter:&lt;br /&gt;
var translated = dojo.string.substitute( &amp;quot;You can pick ${p} cards and discard ${d}&amp;quot;, {&lt;br /&gt;
    p: 2,&lt;br /&gt;
    d: 4&lt;br /&gt;
} );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING:&#039;&#039;&#039; in Javascript strings to translate, you should never use &#039;\n&#039;, &#039;\t&#039; or such, as it will break the translation bundle and result in all the Javascript translation to fail. In any case, the strings will result in HTML code, and such character codes won&#039;t have any impact on the HTML rendering. You should use HTML markup instead.&lt;br /&gt;
&lt;br /&gt;
== On server side (PHP) ==&lt;br /&gt;
&lt;br /&gt;
On PHP side, you can use 3 different functions to specify that a string must be translated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;clienttranslate( &amp;quot;my string to translate&amp;quot; ):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function is &#039;&#039;&#039;transparent&#039;&#039;&#039;: it will return the original English string without any change. It&#039;s only purpose is to mark this string as &amp;quot;must be translated&amp;quot;, and to make sure the translated version of the string will be available on client side.&lt;br /&gt;
&lt;br /&gt;
In general, you use clienttranslate:&lt;br /&gt;
* On your states.inc.php, for field &amp;quot;description&amp;quot; and &amp;quot;descriptionmyturn&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      &amp;quot;description&amp;quot; =&amp;gt; clienttranslate(&#039;${card_name}: ${actplayer} must discard 4 identical energies&#039;),&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* On &amp;quot;material.inc.php&amp;quot;, when defining texts for game material that must be displayed on client side.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$this-&amp;gt;card_types = array(&lt;br /&gt;
&lt;br /&gt;
     1 =&amp;gt; array(&lt;br /&gt;
        &#039;name&#039; =&amp;gt; clienttranslate(&amp;quot;Amulet of Air&amp;quot;), // Thus, we can use &amp;quot;_( card_name )&amp;quot; on Javascript side.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When sending a notification with &amp;quot;notifyAllPlayers&amp;quot; or &amp;quot;notifyPlayer&amp;quot;, for the game log string and all game log arguments that need a translation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // A game log string with no argument:&lt;br /&gt;
     self::notifyAllPlayers( &#039;pickLibraryCards&#039;, clienttranslate(&amp;quot;Everyone draw cards from his library&amp;quot;), array() );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Translating arguments is a little bit more complex. It is using the &amp;quot;i18n&amp;quot; special argument as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 // In the following example, we translate the game log itself, but also the &amp;quot;card_name&amp;quot; argument:&lt;br /&gt;
&lt;br /&gt;
 self::notifyAllPlayers( &#039;winPoints&#039;, clienttranslate(&#039;${card_name}: ${player_name} gains ${points} point(s)&#039;), array(&lt;br /&gt;
                &#039;i18n&#039; =&amp;gt; array( &#039;card_name&#039; ),     // &amp;lt;===== We specify here that &amp;quot;card_name&amp;quot; argument must be transate&lt;br /&gt;
                &#039;player_id&#039; =&amp;gt; $player_id,&lt;br /&gt;
                &#039;player_name&#039; =&amp;gt; self::getActivePlayerName(),&lt;br /&gt;
                &#039;points&#039; =&amp;gt; $points,&lt;br /&gt;
                &#039;card_name&#039; =&amp;gt; $this-&amp;gt;card_types[8][&#039;name&#039;] // &amp;lt;==== Here, we provide original English string.&lt;br /&gt;
            ) ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;self::_( &amp;quot;my string to translate&amp;quot; ):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function returns a string translated in the language of CURRENT user (ie: player who send the request to the server) (be careful, this is NOT the active player).&lt;br /&gt;
&lt;br /&gt;
Most of the time, you don&#039;t need to translate strings on server side, except on the following 3 situations:&lt;br /&gt;
* When throwing an exception because the player did a forbidden move.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// This will display a translatable red message to the player that just do some wrong action:&lt;br /&gt;
throw new feException( self::_(&#039;You must choose 3 cards&#039;), true);&lt;br /&gt;
&lt;br /&gt;
// ... notice the use of &amp;quot;true&amp;quot; parameter that signal that this exception is &amp;quot;expected&amp;quot;. In theory, all exception that are excepted should be translated.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In &amp;quot;yourgame.view.php&amp;quot;, when creating the labels for the game interface used in your template (.tpl) file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$this-&amp;gt;tpl[&#039;CARDS_FOR_YEAR_2&#039;] = self::_(&amp;quot;Your cards for year II&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Eventually, in your material.inc.php, if for example you need to use some string elements in your exceptions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// In material.inc.php, $this-&amp;gt;energies[n][&#039;nametr&#039;] has been created with the self::_() method. This we can do this:&lt;br /&gt;
throw new feException( self::_(&amp;quot;To execute this action you need more: &amp;quot;).&#039; &#039;.$this-&amp;gt;energies[$resource_id][&#039;nametr&#039;], true );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Eventually, in your &amp;quot;getAllDatas&amp;quot; PHP method, as the data return by this method is used only by current user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;totranslate( &amp;quot;my string to translate&amp;quot; ):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function works exactly like &#039;clienttranslate&#039;, except it tells BGA that the string is not needed on client side.&lt;br /&gt;
&lt;br /&gt;
You should not use this function, except on the following cases:&lt;br /&gt;
* Statistics name in stats.inc.php&lt;br /&gt;
* Option names and option values name in gameoptions.inc.php&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Scrollmap&amp;diff=781</id>
		<title>Scrollmap</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Scrollmap&amp;diff=781"/>
		<updated>2013-04-26T13:57:14Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Enable scrollmap zone extension */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scrollmap is a BGA client side component to display an infinite game area.&lt;br /&gt;
&lt;br /&gt;
In some games, players are building the main game area with tiles or cards. Examples:&lt;br /&gt;
* Carcassonne&lt;br /&gt;
* Saboteur&lt;br /&gt;
* Takenoko&lt;br /&gt;
* Taluva&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
Of course this cause an additional difficulty for the adaptation, because we have to display an infinite game area into a finite space on the screen. This is where Scrollmap component can help you.&lt;br /&gt;
&lt;br /&gt;
== Scrollmap in action ==&lt;br /&gt;
&lt;br /&gt;
If you want to see how Scrollmap looks like, please try &amp;quot;Saboteur&amp;quot; or &amp;quot;Takenoko&amp;quot; games on BGA, or watch a game in progress.&lt;br /&gt;
&lt;br /&gt;
In both games, you can see that there are arrow controls around the main game area, so that players can use them to scroll the view. You can also drag&#039;n&#039;drop the game area to scroll.&lt;br /&gt;
&lt;br /&gt;
== How to use Scrollmap ==&lt;br /&gt;
&lt;br /&gt;
At first, don&#039;t forget to add &amp;quot;ebg/scrollmap&amp;quot; as a dependency:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/scrollmap&amp;quot;     /// &amp;lt;==== HERE&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, declare a new variable in your class for the Scrollmap object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        constructor: function(){&lt;br /&gt;
        console.log(&#039;yourgame constructor&#039;);&lt;br /&gt;
              &lt;br /&gt;
        // Scrollable area        	&lt;br /&gt;
        this.scrollmap = new ebg.scrollmap();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, open your template (TPL) file and add this HTML code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;map_container&amp;quot;&amp;gt;&lt;br /&gt;
    	&amp;lt;div id=&amp;quot;map_scrollable&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;map_surface&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;map_scrollable_oversurface&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;movetop&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;moveleft&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;moveright&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;movedown&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are also some lines to add to your CSS stylesheet. Please note that you can adapt it to your needs, especially the default width of the scrollable area:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/** Scrollable area **/&lt;br /&gt;
&lt;br /&gt;
#map_container {&lt;br /&gt;
    position: relative;&lt;br /&gt;
    width: 100%;&lt;br /&gt;
    height: 400px;&lt;br /&gt;
    overflow: hidden;&lt;br /&gt;
}&lt;br /&gt;
#map_scrollable, #map_scrollable_oversurface {&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    top: 205px;&lt;br /&gt;
    left:  315px;&lt;br /&gt;
}&lt;br /&gt;
#map_surface {&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    top: 0px;&lt;br /&gt;
    left: 0px;&lt;br /&gt;
    width: 100%;&lt;br /&gt;
    height: 100%;&lt;br /&gt;
    cursor: move;&lt;br /&gt;
}&lt;br /&gt;
#map_footer {&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, to link your HTML code with your Javascript, place this in your Javascript &amp;quot;Setup&amp;quot; method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   	// Make map scrollable        	&lt;br /&gt;
        this.scrollmap.create( $(&#039;map_container&#039;),$(&#039;map_scrollable&#039;),$(&#039;map_surface&#039;),$(&#039;map_scrollable_oversurface&#039;) );&lt;br /&gt;
        this.scrollmap.setupOnScreenArrows( 150 );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is it! Now, you should see on your game interface a scrollable game area. This is not really impressive though, because you didn&#039;t add anything on the game area yet. This is the next step.&lt;br /&gt;
&lt;br /&gt;
== Scrollable area layers ==&lt;br /&gt;
&lt;br /&gt;
There are 2 - and only 2 - places where you should place your HTML stuff in your scrollable area:&lt;br /&gt;
* inside &amp;quot;map_scrollable&amp;quot; div&lt;br /&gt;
* inside &amp;quot;map_scrollable_oversurface&amp;quot; div&lt;br /&gt;
&lt;br /&gt;
The difference is very important: &amp;quot;map_scrollable&amp;quot; is beneath the surface that is used to drag&#039;n&#039;drop the game area, and &amp;quot;map_scrollable_oversurface&amp;quot; is above this surface. In practice:&lt;br /&gt;
* If some element on the game area need to be clicked (or any kind of user interaction), you should place it in map_scrollable_oversurface, otherwise no click can reach it.&lt;br /&gt;
* If some element on the game area don&#039;t need to be clicked, you&#039;d better place it in &amp;quot;map_scrollable&amp;quot;, so it is possible to drag&#039;n&#039;drop the game area from a point on this element.&lt;br /&gt;
&lt;br /&gt;
Of course, all layers are scrolled synchronously.&lt;br /&gt;
&lt;br /&gt;
Tips: in some situation, it&#039;s also useful to place a game element on map_scrollable and a corresponding invisible element over the surface to manage the interactions. Example: when an interactive element must be placed beneath a non interactive element for display reason.&lt;br /&gt;
&lt;br /&gt;
== Positioning elements on game area ==&lt;br /&gt;
&lt;br /&gt;
All elements on the game are must be absolute positioned (with &amp;quot;top&amp;quot; and &amp;quot;left&amp;quot; attributes).&lt;br /&gt;
&lt;br /&gt;
By default, the game area is centered on 0,0 coordinates.&lt;br /&gt;
&lt;br /&gt;
== Enable move arrows ==&lt;br /&gt;
&lt;br /&gt;
To show move arrows icons around the scrollmap in order to enable click based navigation in addition to drag and drop, add these lines to your CSS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/** Move arrows **/&lt;br /&gt;
&lt;br /&gt;
#movetop,#moveleft,#moveright,#movedown {&lt;br /&gt;
    display: block;&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    background-image: url(&#039;../../img/common/arrows.png&#039;);&lt;br /&gt;
    width: 32px;&lt;br /&gt;
    height: 32px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#movetop {&lt;br /&gt;
    top: 0px;&lt;br /&gt;
    left: 50%;&lt;br /&gt;
    background-position: 0px 32px;&lt;br /&gt;
}&lt;br /&gt;
#moveleft {&lt;br /&gt;
    top: 50%;&lt;br /&gt;
    left: 0px;&lt;br /&gt;
    background-position: 32px 0px;&lt;br /&gt;
}&lt;br /&gt;
#moveright {&lt;br /&gt;
    top: 50%;&lt;br /&gt;
    right: 0px;&lt;br /&gt;
    background-position: 0px 0px;&lt;br /&gt;
}&lt;br /&gt;
#movedown {&lt;br /&gt;
    bottom: 0px;&lt;br /&gt;
    left: 50%;&lt;br /&gt;
    background-position: 32px 32px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In your javascript, define the following functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        onMoveTop : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveTop&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( 0, 300 );&lt;br /&gt;
        },&lt;br /&gt;
        onMoveLeft : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveLeft&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( 300, 0 );&lt;br /&gt;
        },&lt;br /&gt;
        onMoveRight : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveRight&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( -300, 0 );&lt;br /&gt;
        },&lt;br /&gt;
        onMoveDown : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveDown&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( 0, -300 );&lt;br /&gt;
        },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And connect onclick events on the arrows to these functions in your javascript setup&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        dojo.connect( $(&#039;movetop&#039;), &#039;onclick&#039;, this, &#039;onMoveTop&#039; );&lt;br /&gt;
        dojo.connect( $(&#039;moveleft&#039;), &#039;onclick&#039;, this, &#039;onMoveLeft&#039; );&lt;br /&gt;
        dojo.connect( $(&#039;moveright&#039;), &#039;onclick&#039;, this, &#039;onMoveRight&#039; );&lt;br /&gt;
        dojo.connect( $(&#039;movedown&#039;), &#039;onclick&#039;, this, &#039;onMoveDown&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enable scrollmap zone extension ==&lt;br /&gt;
&lt;br /&gt;
This is optional, when there can be unused screen space under the scrollmap that a player might want to use.&lt;br /&gt;
Add this in your .tpl after the scrollmap div (the matching css rules has already been defined):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;map_footer&amp;quot; class=&amp;quot;whiteblock&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;a href=&amp;quot;#&amp;quot; id=&amp;quot;enlargedisplay&amp;quot;&amp;gt;&amp;amp;darr;&amp;amp;nbsp;&amp;amp;nbsp;{LABEL_ENLARGE_DISPLAY}&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;darr;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In your javascript, define the following function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        onIncreaseDisplayHeight: function( evt )&lt;br /&gt;
        {&lt;br /&gt;
        	console.log( &#039;$$$$ Event : onIncreaseDisplayHeight&#039; );&lt;br /&gt;
        	evt.preventDefault();&lt;br /&gt;
        	&lt;br /&gt;
            var cur_h = toint( dojo.style( $(&#039;map_container&#039;), &#039;height&#039; ) );&lt;br /&gt;
            dojo.style( $(&#039;map_container&#039;), &#039;height&#039;, ( cur_h+300 ) + &#039;px&#039; );&lt;br /&gt;
        },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and connect them to the &#039;enlargedisplay&#039; link in your setup:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dojo.connect( $(&#039;enlargedisplay&#039;), &#039;onclick&#039;, this, &#039;onIncreaseDisplayHeight&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In your view.php file, define the template variable LABEL_ENLARGE_DISPLAY so that it gets substituted with appropriate translatable text:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$this-&amp;gt;tpl[&#039;LABEL_ENLARGE_DISPLAY&#039;] = self::_(&amp;quot;Enlarge display&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Scrollmap&amp;diff=780</id>
		<title>Scrollmap</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Scrollmap&amp;diff=780"/>
		<updated>2013-04-26T13:53:16Z</updated>

		<summary type="html">&lt;p&gt;Een: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scrollmap is a BGA client side component to display an infinite game area.&lt;br /&gt;
&lt;br /&gt;
In some games, players are building the main game area with tiles or cards. Examples:&lt;br /&gt;
* Carcassonne&lt;br /&gt;
* Saboteur&lt;br /&gt;
* Takenoko&lt;br /&gt;
* Taluva&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
Of course this cause an additional difficulty for the adaptation, because we have to display an infinite game area into a finite space on the screen. This is where Scrollmap component can help you.&lt;br /&gt;
&lt;br /&gt;
== Scrollmap in action ==&lt;br /&gt;
&lt;br /&gt;
If you want to see how Scrollmap looks like, please try &amp;quot;Saboteur&amp;quot; or &amp;quot;Takenoko&amp;quot; games on BGA, or watch a game in progress.&lt;br /&gt;
&lt;br /&gt;
In both games, you can see that there are arrow controls around the main game area, so that players can use them to scroll the view. You can also drag&#039;n&#039;drop the game area to scroll.&lt;br /&gt;
&lt;br /&gt;
== How to use Scrollmap ==&lt;br /&gt;
&lt;br /&gt;
At first, don&#039;t forget to add &amp;quot;ebg/scrollmap&amp;quot; as a dependency:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/scrollmap&amp;quot;     /// &amp;lt;==== HERE&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, declare a new variable in your class for the Scrollmap object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        constructor: function(){&lt;br /&gt;
        console.log(&#039;yourgame constructor&#039;);&lt;br /&gt;
              &lt;br /&gt;
        // Scrollable area        	&lt;br /&gt;
        this.scrollmap = new ebg.scrollmap();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, open your template (TPL) file and add this HTML code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;map_container&amp;quot;&amp;gt;&lt;br /&gt;
    	&amp;lt;div id=&amp;quot;map_scrollable&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;map_surface&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;map_scrollable_oversurface&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;movetop&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;moveleft&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;moveright&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;movedown&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are also some lines to add to your CSS stylesheet. Please note that you can adapt it to your needs, especially the default width of the scrollable area:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/** Scrollable area **/&lt;br /&gt;
&lt;br /&gt;
#map_container {&lt;br /&gt;
    position: relative;&lt;br /&gt;
    width: 100%;&lt;br /&gt;
    height: 400px;&lt;br /&gt;
    overflow: hidden;&lt;br /&gt;
}&lt;br /&gt;
#map_scrollable, #map_scrollable_oversurface {&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    top: 205px;&lt;br /&gt;
    left:  315px;&lt;br /&gt;
}&lt;br /&gt;
#map_surface {&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    top: 0px;&lt;br /&gt;
    left: 0px;&lt;br /&gt;
    width: 100%;&lt;br /&gt;
    height: 100%;&lt;br /&gt;
    cursor: move;&lt;br /&gt;
}&lt;br /&gt;
#map_footer {&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, to link your HTML code with your Javascript, place this in your Javascript &amp;quot;Setup&amp;quot; method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   	// Make map scrollable        	&lt;br /&gt;
        this.scrollmap.create( $(&#039;map_container&#039;),$(&#039;map_scrollable&#039;),$(&#039;map_surface&#039;),$(&#039;map_scrollable_oversurface&#039;) );&lt;br /&gt;
        this.scrollmap.setupOnScreenArrows( 150 );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is it! Now, you should see on your game interface a scrollable game area. This is not really impressive though, because you didn&#039;t add anything on the game area yet. This is the next step.&lt;br /&gt;
&lt;br /&gt;
== Scrollable area layers ==&lt;br /&gt;
&lt;br /&gt;
There are 2 - and only 2 - places where you should place your HTML stuff in your scrollable area:&lt;br /&gt;
* inside &amp;quot;map_scrollable&amp;quot; div&lt;br /&gt;
* inside &amp;quot;map_scrollable_oversurface&amp;quot; div&lt;br /&gt;
&lt;br /&gt;
The difference is very important: &amp;quot;map_scrollable&amp;quot; is beneath the surface that is used to drag&#039;n&#039;drop the game area, and &amp;quot;map_scrollable_oversurface&amp;quot; is above this surface. In practice:&lt;br /&gt;
* If some element on the game area need to be clicked (or any kind of user interaction), you should place it in map_scrollable_oversurface, otherwise no click can reach it.&lt;br /&gt;
* If some element on the game area don&#039;t need to be clicked, you&#039;d better place it in &amp;quot;map_scrollable&amp;quot;, so it is possible to drag&#039;n&#039;drop the game area from a point on this element.&lt;br /&gt;
&lt;br /&gt;
Of course, all layers are scrolled synchronously.&lt;br /&gt;
&lt;br /&gt;
Tips: in some situation, it&#039;s also useful to place a game element on map_scrollable and a corresponding invisible element over the surface to manage the interactions. Example: when an interactive element must be placed beneath a non interactive element for display reason.&lt;br /&gt;
&lt;br /&gt;
== Positioning elements on game area ==&lt;br /&gt;
&lt;br /&gt;
All elements on the game are must be absolute positioned (with &amp;quot;top&amp;quot; and &amp;quot;left&amp;quot; attributes).&lt;br /&gt;
&lt;br /&gt;
By default, the game area is centered on 0,0 coordinates.&lt;br /&gt;
&lt;br /&gt;
== Enable move arrows ==&lt;br /&gt;
&lt;br /&gt;
To show move arrows icons around the scrollmap in order to enable click based navigation in addition to drag and drop, add these lines to your CSS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/** Move arrows **/&lt;br /&gt;
&lt;br /&gt;
#movetop,#moveleft,#moveright,#movedown {&lt;br /&gt;
    display: block;&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    background-image: url(&#039;../../img/common/arrows.png&#039;);&lt;br /&gt;
    width: 32px;&lt;br /&gt;
    height: 32px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#movetop {&lt;br /&gt;
    top: 0px;&lt;br /&gt;
    left: 50%;&lt;br /&gt;
    background-position: 0px 32px;&lt;br /&gt;
}&lt;br /&gt;
#moveleft {&lt;br /&gt;
    top: 50%;&lt;br /&gt;
    left: 0px;&lt;br /&gt;
    background-position: 32px 0px;&lt;br /&gt;
}&lt;br /&gt;
#moveright {&lt;br /&gt;
    top: 50%;&lt;br /&gt;
    right: 0px;&lt;br /&gt;
    background-position: 0px 0px;&lt;br /&gt;
}&lt;br /&gt;
#movedown {&lt;br /&gt;
    bottom: 0px;&lt;br /&gt;
    left: 50%;&lt;br /&gt;
    background-position: 32px 32px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In your javascript, define the following functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        onMoveTop : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveTop&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( 0, 300 );&lt;br /&gt;
        },&lt;br /&gt;
        onMoveLeft : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveLeft&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( 300, 0 );&lt;br /&gt;
        },&lt;br /&gt;
        onMoveRight : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveRight&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( -300, 0 );&lt;br /&gt;
        },&lt;br /&gt;
        onMoveDown : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveDown&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( 0, -300 );&lt;br /&gt;
        },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And connect onclick events on the arrows to these functions in your javascript setup&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        dojo.connect( $(&#039;movetop&#039;), &#039;onclick&#039;, this, &#039;onMoveTop&#039; );&lt;br /&gt;
        dojo.connect( $(&#039;moveleft&#039;), &#039;onclick&#039;, this, &#039;onMoveLeft&#039; );&lt;br /&gt;
        dojo.connect( $(&#039;moveright&#039;), &#039;onclick&#039;, this, &#039;onMoveRight&#039; );&lt;br /&gt;
        dojo.connect( $(&#039;movedown&#039;), &#039;onclick&#039;, this, &#039;onMoveDown&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enable scrollmap zone extension ==&lt;br /&gt;
&lt;br /&gt;
This is optional, when there can be unused screen space under the scrollmap that a player might want to use.&lt;br /&gt;
Add this in your .tpl after the scrollmap div (the matching css rules has already been defined):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;map_footer&amp;quot; class=&amp;quot;whiteblock&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;a href=&amp;quot;#&amp;quot; id=&amp;quot;enlargedisplay&amp;quot;&amp;gt;&amp;amp;darr;&amp;amp;nbsp;&amp;amp;nbsp;{LABEL_ENLARGE_DISPLAY}&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;darr;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In your javascript, define the following function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        onIncreaseDisplayHeight: function( evt )&lt;br /&gt;
        {&lt;br /&gt;
        	console.log( &#039;$$$$ Event : onIncreaseDisplayHeight&#039; );&lt;br /&gt;
        	evt.preventDefault();&lt;br /&gt;
        	&lt;br /&gt;
            var cur_h = toint( dojo.style( $(&#039;map_container&#039;), &#039;height&#039; ) );&lt;br /&gt;
            dojo.style( $(&#039;map_container&#039;), &#039;height&#039;, ( cur_h+300 ) + &#039;px&#039; );&lt;br /&gt;
        },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and connect them to the &#039;enlargedisplay&#039; link in your setup:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dojo.connect( $(&#039;enlargedisplay&#039;), &#039;onclick&#039;, this, &#039;onIncreaseDisplayHeight&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Studio_FAQ&amp;diff=779</id>
		<title>Studio FAQ</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Studio_FAQ&amp;diff=779"/>
		<updated>2013-04-25T20:03:11Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Should I use images free from copyright? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a place where we will collect and answer frequently asked questions.&lt;br /&gt;
&lt;br /&gt;
== What should I use to access the files through SFTP? ==&lt;br /&gt;
&lt;br /&gt;
There is a lot of tools to do that. Use the one you are the most comfortable with.&lt;br /&gt;
&lt;br /&gt;
On Linux Gnome, you can for example use the &#039;Connect to server&#039; function of the Nautilus file management system, or use sshfs.&lt;br /&gt;
&lt;br /&gt;
On Windows, there is for example the [http://winscp.net/ WinSCP client].&lt;br /&gt;
&lt;br /&gt;
== I can&#039;t edit the files in my game directory, it looks like they are readonly. What&#039;s happening? ==&lt;br /&gt;
&lt;br /&gt;
Maybe there is a maintenance operation underway.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t get access back after some time (say one or two hours), please send us a mail to check.&lt;br /&gt;
&lt;br /&gt;
== I can&#039;t access the Studio back-office, I get a &#039;Not authorized&#039; error message? ==&lt;br /&gt;
&lt;br /&gt;
You should first connect to the Studio website (with any of your &amp;lt;developer name&amp;gt;&amp;lt;number&amp;gt; accounts). As the authentication is shared with the back-office, then you will be able to access it.&lt;br /&gt;
&lt;br /&gt;
== I don&#039;t know the name to use to commit my game, what name should I use? ==&lt;br /&gt;
&lt;br /&gt;
The game name for committing is the name of the game in lower case and without spaces or special characters (ex: puertorico).&lt;br /&gt;
It is the same name as the name used for the game folder in your SFTP access.&lt;br /&gt;
&lt;br /&gt;
== What is the working language on BGA studio? ==&lt;br /&gt;
&lt;br /&gt;
Working language is &#039;&#039;&#039;English&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Variables and functions must be named with English words.&lt;br /&gt;
&lt;br /&gt;
Comments must be written in English.&lt;br /&gt;
&lt;br /&gt;
Game interface strings and game logs must be written in English.&lt;br /&gt;
&lt;br /&gt;
== How can I provide translation in my language? == &lt;br /&gt;
&lt;br /&gt;
BGA administrators will translate the game in French before the game release.&lt;br /&gt;
&lt;br /&gt;
After the game release, the collaborative translation interface can be used to translate into other languages.&lt;br /&gt;
&lt;br /&gt;
Check [[Translations]] to see how to make your game translatable.&lt;br /&gt;
&lt;br /&gt;
== I updated the images in the &#039;img&#039; folder of my game, but they don&#039;t show? ==&lt;br /&gt;
&lt;br /&gt;
On BGA Studio, there is the gameserver you are developing on, and the main site server that is used to launch the games. The game icon, box and the publisher logo are hosted on the main site server, so they are not immediately available when you modify them on the gameserver. To deploy them on the main site, you have to use the [[Studio back-office]] to do a commit.&lt;br /&gt;
&lt;br /&gt;
If the images still don&#039;t show after that, please try emptying your browser cache and reloading the page.&lt;br /&gt;
&lt;br /&gt;
== I added some game options / some game statistics, but they don&#039;t show? ==&lt;br /&gt;
&lt;br /&gt;
An extra deployment action from the BGA administrators is needed to activate new game options and statistics. Please contact us.&lt;br /&gt;
&lt;br /&gt;
== Should I use images free from copyright? ==&lt;br /&gt;
&lt;br /&gt;
If you are developing a game in the public domain, yes (or you can make your own if you feel it&#039;s better). &lt;br /&gt;
&lt;br /&gt;
If you are developing a game for which we have a licence, we will usually provide art files from the publisher.&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Studio_FAQ&amp;diff=778</id>
		<title>Studio FAQ</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Studio_FAQ&amp;diff=778"/>
		<updated>2013-04-25T20:01:50Z</updated>

		<summary type="html">&lt;p&gt;Een: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a place where we will collect and answer frequently asked questions.&lt;br /&gt;
&lt;br /&gt;
== What should I use to access the files through SFTP? ==&lt;br /&gt;
&lt;br /&gt;
There is a lot of tools to do that. Use the one you are the most comfortable with.&lt;br /&gt;
&lt;br /&gt;
On Linux Gnome, you can for example use the &#039;Connect to server&#039; function of the Nautilus file management system, or use sshfs.&lt;br /&gt;
&lt;br /&gt;
On Windows, there is for example the [http://winscp.net/ WinSCP client].&lt;br /&gt;
&lt;br /&gt;
== I can&#039;t edit the files in my game directory, it looks like they are readonly. What&#039;s happening? ==&lt;br /&gt;
&lt;br /&gt;
Maybe there is a maintenance operation underway.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t get access back after some time (say one or two hours), please send us a mail to check.&lt;br /&gt;
&lt;br /&gt;
== I can&#039;t access the Studio back-office, I get a &#039;Not authorized&#039; error message? ==&lt;br /&gt;
&lt;br /&gt;
You should first connect to the Studio website (with any of your &amp;lt;developer name&amp;gt;&amp;lt;number&amp;gt; accounts). As the authentication is shared with the back-office, then you will be able to access it.&lt;br /&gt;
&lt;br /&gt;
== I don&#039;t know the name to use to commit my game, what name should I use? ==&lt;br /&gt;
&lt;br /&gt;
The game name for committing is the name of the game in lower case and without spaces or special characters (ex: puertorico).&lt;br /&gt;
It is the same name as the name used for the game folder in your SFTP access.&lt;br /&gt;
&lt;br /&gt;
== What is the working language on BGA studio? ==&lt;br /&gt;
&lt;br /&gt;
Working language is &#039;&#039;&#039;English&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Variables and functions must be named with English words.&lt;br /&gt;
&lt;br /&gt;
Comments must be written in English.&lt;br /&gt;
&lt;br /&gt;
Game interface strings and game logs must be written in English.&lt;br /&gt;
&lt;br /&gt;
== How can I provide translation in my language? == &lt;br /&gt;
&lt;br /&gt;
BGA administrators will translate the game in French before the game release.&lt;br /&gt;
&lt;br /&gt;
After the game release, the collaborative translation interface can be used to translate into other languages.&lt;br /&gt;
&lt;br /&gt;
Check [[Translations]] to see how to make your game translatable.&lt;br /&gt;
&lt;br /&gt;
== I updated the images in the &#039;img&#039; folder of my game, but they don&#039;t show? ==&lt;br /&gt;
&lt;br /&gt;
On BGA Studio, there is the gameserver you are developing on, and the main site server that is used to launch the games. The game icon, box and the publisher logo are hosted on the main site server, so they are not immediately available when you modify them on the gameserver. To deploy them on the main site, you have to use the [[Studio back-office]] to do a commit.&lt;br /&gt;
&lt;br /&gt;
If the images still don&#039;t show after that, please try emptying your browser cache and reloading the page.&lt;br /&gt;
&lt;br /&gt;
== I added some game options / some game statistics, but they don&#039;t show? ==&lt;br /&gt;
&lt;br /&gt;
An extra deployment action from the BGA administrators is needed to activate new game options and statistics. Please contact us.&lt;br /&gt;
&lt;br /&gt;
== Should I use images free from copyright? ==&lt;br /&gt;
&lt;br /&gt;
If you are developing a game in the public domain, yes (or you can make your own if you feel it&#039;s better). &lt;br /&gt;
If you are developing a game for which we have a licence, we will usually provide art files from the publisher.&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=How_to_join_BGA_developer_team%3F&amp;diff=777</id>
		<title>How to join BGA developer team?</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=How_to_join_BGA_developer_team%3F&amp;diff=777"/>
		<updated>2013-04-24T20:19:05Z</updated>

		<summary type="html">&lt;p&gt;Een: ²&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
   &#039;&#039;&#039;--- Notice ---&#039;&#039;&#039;&lt;br /&gt;
   We have received a lot of positive feedback on the Studio, and lots of developers have registered.&lt;br /&gt;
   We are very happy about it, but it comes with a cost in time spent answering emails and posts on the forum.&lt;br /&gt;
   So please bear with us if we are slow to answer. As soon as we can, we will.&lt;br /&gt;
   Thanks again for your interest!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Registering is done by e-mail at &#039;&#039;&#039;studio(at)boardgamearena.com&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Please provide the following information:&lt;br /&gt;
* your player user name on BGA&lt;br /&gt;
* your developer user name to be used on “BGA Studio” (for technical reasons, no space, number or special character);&lt;br /&gt;
* your real name;&lt;br /&gt;
* your e-mail address;&lt;br /&gt;
* your postal address.&lt;br /&gt;
&lt;br /&gt;
We also drafted a quick [http://en.doc.boardgamearena.com/images/0/02/BGA_TC_Dev_en.pdf &#039;&#039;&#039;&#039;terms &amp;amp; conditions&#039; document&#039;&#039;&#039;]. It&#039;s very light, so as to get to the fun part faster.&lt;br /&gt;
&lt;br /&gt;
To be valid, the registration e-mail must contain this document as an attachment, with the following sentence in the mail body: &#039;&#039;&#039;&#039;I agree with the terms &amp;amp; conditions for developers on BGA Studio joined as an attachment&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
And of course, we also encourage you to tell us about your developer experience and which games you would love to develop on BGA!&lt;br /&gt;
&lt;br /&gt;
== Ok, I registered, what do I get? ==&lt;br /&gt;
&lt;br /&gt;
First, we&#039;ll discuss by e-mail the names of some of the games we have an agreement to develop, so that you can tell us &#039;Hey, this game is great! I want to develop it!&#039; (please keep these names confidential, or it would ruin our tradition to make players guess the name of the next game on the forum)&lt;br /&gt;
&lt;br /&gt;
Second, once we have discussed together and are set on a game you&#039;ll take charge of, we&#039;ll create your studio account and you will get:&lt;br /&gt;
* one login / password to access files through SFTP&lt;br /&gt;
* ten logins with numeric suffixes from 0 to 9 and a common simple password to test games on the studio website while developing.&lt;br /&gt;
&lt;br /&gt;
Once logged in to your SFTP root folder, you will find:&lt;br /&gt;
* a &#039;&#039;&#039;&#039;resources.html&#039;&#039;&#039;&#039; file with the URLs to use and some extra connection information&lt;br /&gt;
* three folders containing the three simple games provided as examples&lt;br /&gt;
* a folder for the game you will be developing initialized after our &#039;EmptyGame&#039; template, providing the game structure (and comments! and examples!)&lt;br /&gt;
&lt;br /&gt;
Then... well that&#039;s all, you can start! See  [[Studio#Great.2C_I.27m_in.21_..._How_should_I_start.3F|Great, I&#039;m in! ... How should I start?]]&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Zone&amp;diff=772</id>
		<title>Zone</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Zone&amp;diff=772"/>
		<updated>2013-04-20T17:42:40Z</updated>

		<summary type="html">&lt;p&gt;Een: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Zone component is meant to organise items of the same type inside a predefined space.&lt;br /&gt;
&lt;br /&gt;
== Zone in action ==&lt;br /&gt;
&lt;br /&gt;
If you want to see how Zone works, please try &amp;quot;Can&#039;t Stop&amp;quot; or &amp;quot;Niagara&amp;quot; on BGA, or watch a game in progress or game replay.&lt;br /&gt;
&lt;br /&gt;
In Can&#039;t Stop, zone is used to display the bhikkus ascending the mountain when there is more than one on the same space (diagonal mode).&lt;br /&gt;
&lt;br /&gt;
In Niagara, it is used to display the canoes over the circles going down the river (custom mode).&lt;br /&gt;
&lt;br /&gt;
== How to use Zone == &lt;br /&gt;
&lt;br /&gt;
At first, don&#039;t forget to add &amp;quot;ebg/zone&amp;quot; as a dependency:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/zone&amp;quot;     /// &amp;lt;==== HERE&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, declare a new variable in your class for the Zone object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        constructor: function(){&lt;br /&gt;
        console.log(&#039;yourgame constructor&#039;);&lt;br /&gt;
              &lt;br /&gt;
        // Zone control        	&lt;br /&gt;
        this.myZone = new ebg.scrollmap();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, in your template file, you must add a div that will host this zone:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;my_zone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And set its width (and optionnaly, height and position) in CSS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#my_zone {&lt;br /&gt;
  width: 100px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then in your Javascript setup, attach your Zone component to the div and define its properties :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            zone.create( this, &#039;my_zone&#039;, &amp;lt;item_width&amp;gt;, &amp;lt;item_height&amp;gt; );&lt;br /&gt;
            zone.setPattern( &amp;lt;mode&amp;gt; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;item_width&amp;gt; is an integer for the width of the objects you want to organise in the zone&lt;br /&gt;
* &amp;lt;item_height&amp;gt; is an integer for the height of the objects you want to organise in the zone &lt;br /&gt;
* &amp;lt;mode&amp;gt; is one of &#039;grid&#039; (objects will be put on lines from top left to bottom right, wrapping when there is not enough space left on the line) &#039;diagonal&#039; (objects will be organised on a top left to bottom right diagonal, overlapping each other) or &#039;custom&#039; (objects will be organised depending upon their number and the coordinates that you provide - see below)&lt;br /&gt;
&lt;br /&gt;
Now your zone is ready to be used!&lt;br /&gt;
&lt;br /&gt;
After creating an object that you want to add to the zone as a classic HTML template (dojo.place / this.format_block), you can simply use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   zone.placeInZone( &amp;lt;object_id&amp;gt;, &amp;lt;weight&amp;gt; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;object_id&amp;gt; is the string identifier for your object &#039;my_object_id&#039;&lt;br /&gt;
* &amp;lt;weight&amp;gt; is an optional parameter used to sort items&lt;br /&gt;
&lt;br /&gt;
To remove an item, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   zone.removeFromZone( &amp;lt;object_id&amp;gt;, &amp;lt;destroy?&amp;gt;, &amp;lt;to&amp;gt; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;object_id&amp;gt; is the string identifier for your object &#039;my_object_id&#039;&lt;br /&gt;
* &amp;lt;destroy?&amp;gt; is a boolean indicating if the object should be destroyed after being removed&lt;br /&gt;
* &amp;lt;to&amp;gt; is the destination the object must be slided to when being removed (before being eventually destroyed)&lt;br /&gt;
&lt;br /&gt;
You can also:&lt;br /&gt;
* remove all items from the zone (and destroy them) using zone.removeAll();&lt;br /&gt;
* get the number of items in your zone using zone.getItemNumber();&lt;br /&gt;
* get an array of the ids of all the items using zone.getAllItems();&lt;br /&gt;
&lt;br /&gt;
== Custom mode == &lt;br /&gt;
&lt;br /&gt;
If you want complete control on how your objects are laid out inside the Zone, you can determine their coordinates after their number when being added to the zone. Here is how to do it, when defining your Zone properties in the javascript setup:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                this.zone.setPattern( &#039;custom&#039; );&lt;br /&gt;
                &lt;br /&gt;
                this.zone.itemIdToCoords = function( i, control_width ) {&lt;br /&gt;
                    if( i%8==0 )&lt;br /&gt;
                    {   return {  x:1,y:19, w:60, h:30 }; }&lt;br /&gt;
                    else if( i%8==1 )&lt;br /&gt;
                    {   return {  x:30,y:38, w:60, h:30 }; }&lt;br /&gt;
                    else if( i%8==2 )&lt;br /&gt;
                    {   return {  x:42,y:8, w:60, h:30 }; }&lt;br /&gt;
                    else if( i%8==3 )&lt;br /&gt;
                    {   return {  x:5,y:58, w:60, h:30 }; }&lt;br /&gt;
                    else if( i%8==4 )&lt;br /&gt;
                    {   return {  x:5,y:24, w:60, h:30 }; }&lt;br /&gt;
                    else if( i%8==5 )&lt;br /&gt;
                    {   return {  x:35,y:43, w:60, h:30 }; }&lt;br /&gt;
                    else if( i%8==6 )&lt;br /&gt;
                    {   return {  x:47,y:13, w:60, h:30 }; }&lt;br /&gt;
                    else if( i%8==7 )&lt;br /&gt;
                    {   return {  x:10,y:63, w:60, h:30 }; }&lt;br /&gt;
                };&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Zone&amp;diff=771</id>
		<title>Zone</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Zone&amp;diff=771"/>
		<updated>2013-04-20T17:38:13Z</updated>

		<summary type="html">&lt;p&gt;Een: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Zone component is meant to organise items of the same type inside a predefined space.&lt;br /&gt;
&lt;br /&gt;
== Zone in action ==&lt;br /&gt;
&lt;br /&gt;
If you want to see how Zone works, please try &amp;quot;Can&#039;t Stop&amp;quot; or &amp;quot;Niagara&amp;quot; on BGA, or watch a game in progress or game replay.&lt;br /&gt;
&lt;br /&gt;
In Can&#039;t Stop, zone is used to display the bhikkus ascending the mountain when there is more than one on the same space (diagonal mode).&lt;br /&gt;
&lt;br /&gt;
In Niagara, it is used to display the canoes over the circles going down the river (custom mode).&lt;br /&gt;
&lt;br /&gt;
== How to use Zone == &lt;br /&gt;
&lt;br /&gt;
At first, don&#039;t forget to add &amp;quot;ebg/zone&amp;quot; as a dependency:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/zone&amp;quot;     /// &amp;lt;==== HERE&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, declare a new variable in your class for the Zone object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        constructor: function(){&lt;br /&gt;
        console.log(&#039;yourgame constructor&#039;);&lt;br /&gt;
              &lt;br /&gt;
        // Zone control        	&lt;br /&gt;
        this.myZone = new ebg.scrollmap();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, in your template file, you must add a div that will host this zone:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;my_zone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And set its width (and optionnaly, height and position) in CSS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#my_zone {&lt;br /&gt;
  width: 100px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then in your Javascript setup, attach your Zone component to the div and define its properties :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            zone.create( this, &#039;my_zone&#039;, &amp;lt;item_width&amp;gt;, &amp;lt;item_height&amp;gt; );&lt;br /&gt;
            zone.setPattern( &amp;lt;mode&amp;gt; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;item_width&amp;gt; is an integer for the width of the objects you want to organise in the zone&lt;br /&gt;
* &amp;lt;item_height&amp;gt; is an integer for the height of the objects you want to organise in the zone &lt;br /&gt;
* &amp;lt;mode&amp;gt; is one of &#039;grid&#039; (objects will be put on lines from top left to bottom right, wrapping when there is not enough space left on the line) &#039;diagonal&#039; (objects will be organised on a top left to bottom right diagonal, overlapping each other) or &#039;custom&#039; (objects will be organised depending upon their number and the coordinates that you provide - see below)&lt;br /&gt;
&lt;br /&gt;
Now your zone is ready to be used!&lt;br /&gt;
&lt;br /&gt;
After creating an object that you want to add to the zone as a classic HTML template (dojo.place / this.format_block), you can simply use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   zone.placeInZone( &amp;lt;object_id&amp;gt;, &amp;lt;weight&amp;gt; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;object_id&amp;gt; is the string identifier for your object &#039;my_object_id&#039;&lt;br /&gt;
* &amp;lt;weight&amp;gt; is an optional parameter used to sort items&lt;br /&gt;
&lt;br /&gt;
To remove an item, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   zone.removeFromZone( &amp;lt;object_id&amp;gt;, &amp;lt;destroy?&amp;gt;, &amp;lt;to&amp;gt; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;object_id&amp;gt; is the string identifier for your object &#039;my_object_id&#039;&lt;br /&gt;
* &amp;lt;destroy?&amp;gt; is a boolean indicating if the object should be destroyed after being removed&lt;br /&gt;
* &amp;lt;to&amp;gt; is the destination the object must be slided to when being removed (before being eventually destroyed)&lt;br /&gt;
&lt;br /&gt;
You can also:&lt;br /&gt;
* remove all items from the zone (and destroy them) using zone.removeAll();&lt;br /&gt;
* get the number of items in your zone using zone.getItemNumber();&lt;br /&gt;
* get an array of the ids of all the items using zone.getAllItems();&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Zone&amp;diff=770</id>
		<title>Zone</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Zone&amp;diff=770"/>
		<updated>2013-04-20T17:16:41Z</updated>

		<summary type="html">&lt;p&gt;Een: Created page with &amp;quot;The Zone component is meant to organise items of the same type inside a predefined space.  == Zone in action ==  If you want to see how Zone works, please try &amp;quot;Can&amp;#039;t Stop&amp;quot; or ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Zone component is meant to organise items of the same type inside a predefined space.&lt;br /&gt;
&lt;br /&gt;
== Zone in action ==&lt;br /&gt;
&lt;br /&gt;
If you want to see how Zone works, please try &amp;quot;Can&#039;t Stop&amp;quot; or &amp;quot;Niagara&amp;quot; on BGA, or watch a game in progress or game replay.&lt;br /&gt;
&lt;br /&gt;
In Can&#039;t Stop, zone is used to display the bhikkus ascending the mountain when there is more than one on the same space (diagonal mode).&lt;br /&gt;
&lt;br /&gt;
In Niagara, it is used to display the canoes over the circles going down the river (custom mode).&lt;br /&gt;
&lt;br /&gt;
== How to use Zone == &lt;br /&gt;
&lt;br /&gt;
At first, don&#039;t forget to add &amp;quot;ebg/zone&amp;quot; as a dependency:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/zone&amp;quot;     /// &amp;lt;==== HERE&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, declare a new variable in your class for the Zone object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        constructor: function(){&lt;br /&gt;
        console.log(&#039;yourgame constructor&#039;);&lt;br /&gt;
              &lt;br /&gt;
        // Zone control        	&lt;br /&gt;
        this.myZone = new ebg.scrollmap();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, in your template file, you must add a div that will host this zone:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;my_zone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And set its width (and optionnaly, height and position) in CSS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#my_zone {&lt;br /&gt;
  width: 100px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then in your Javascript setup, attach your Zone component to the div and define its properties :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            zone.create( this, &#039;my_zone&#039;, &amp;lt;item_width&amp;gt;, &amp;lt;item_height&amp;gt; );&lt;br /&gt;
            zone.setPattern( &amp;lt;mode&amp;gt; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;item_width&amp;gt; is an integer for the width of the objects you want to organise in the zone&lt;br /&gt;
* &amp;lt;item_height&amp;gt; is an integer for the height of the objects you want to organise in the zone &lt;br /&gt;
* &amp;lt;mode&amp;gt; is one of &#039;grid&#039; (objects will be put on lines from top left to bottom right, wrapping when there is not enough space left on the line) &#039;diagonal&#039; (objects will be organised on a top left to bottom right diagonal, overlapping each other) or &#039;custom&#039; (objects will be organised depending upon their number and the coordinates that you provide - see below)&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Scrollmap&amp;diff=769</id>
		<title>Scrollmap</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Scrollmap&amp;diff=769"/>
		<updated>2013-04-20T16:23:55Z</updated>

		<summary type="html">&lt;p&gt;Een: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scrollmap is a BGA client side component to display an infinite game area.&lt;br /&gt;
&lt;br /&gt;
In some games, players are building the main game area with tiles or cards. Examples:&lt;br /&gt;
* Carcassonne&lt;br /&gt;
* Saboteur&lt;br /&gt;
* Takenoko&lt;br /&gt;
* Taluva&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
Of course this cause an additional difficulty for the adaptation, because we have to display an infinite game area into a finite space on the screen. This is where Scrollmap component can help you.&lt;br /&gt;
&lt;br /&gt;
== Scrollmap in action ==&lt;br /&gt;
&lt;br /&gt;
If you want to see how Scrollmap looks like, please try &amp;quot;Saboteur&amp;quot; or &amp;quot;Takenoko&amp;quot; games on BGA, or watch a game in progress.&lt;br /&gt;
&lt;br /&gt;
In both games, you can see that there are arrow controls around the main game area, so that players can use them to scroll the view. You can also drag&#039;n&#039;drop the game area to scroll.&lt;br /&gt;
&lt;br /&gt;
== How to use Scrollmap ==&lt;br /&gt;
&lt;br /&gt;
At first, don&#039;t forget to add &amp;quot;ebg/scrollmap&amp;quot; as a dependency:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/scrollmap&amp;quot;     /// &amp;lt;==== HERE&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, declare a new variable in your class for the Scrollmap object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        constructor: function(){&lt;br /&gt;
        console.log(&#039;yourgame constructor&#039;);&lt;br /&gt;
              &lt;br /&gt;
        // Scrollable area        	&lt;br /&gt;
        this.scrollmap = new ebg.scrollmap();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, open your template (TPL) file and add this HTML code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;map_container&amp;quot;&amp;gt;&lt;br /&gt;
    	&amp;lt;div id=&amp;quot;map_scrollable&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;map_surface&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;map_scrollable_oversurface&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;movetop&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;moveleft&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;moveright&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;movedown&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are also some lines to add to your CSS stylesheet. Please note that you can adapt it to your needs, especially the default width of the scrollable area:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/** Scrollable area **/&lt;br /&gt;
&lt;br /&gt;
#map_container {&lt;br /&gt;
    position: relative;&lt;br /&gt;
    width: 100%;&lt;br /&gt;
    height: 400px;&lt;br /&gt;
    overflow: hidden;&lt;br /&gt;
}&lt;br /&gt;
#map_scrollable, #map_scrollable_oversurface {&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    top: 205px;&lt;br /&gt;
    left:  315px;&lt;br /&gt;
}&lt;br /&gt;
#map_surface {&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    top: 0px;&lt;br /&gt;
    left: 0px;&lt;br /&gt;
    width: 100%;&lt;br /&gt;
    height: 100%;&lt;br /&gt;
    cursor: move;&lt;br /&gt;
}&lt;br /&gt;
#map_footer {&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, to link your HTML code with your Javascript, place this in your Javascript &amp;quot;Setup&amp;quot; method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   	// Make map scrollable        	&lt;br /&gt;
        this.scrollmap.create( $(&#039;map_container&#039;),$(&#039;map_scrollable&#039;),$(&#039;map_surface&#039;),$(&#039;map_scrollable_oversurface&#039;) );&lt;br /&gt;
        this.scrollmap.setupOnScreenArrows( 150 );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is it! Now, you should see on your game interface a scrollable game area. This is not really impressive though, because you didn&#039;t add anything on the game area yet. This is the next step.&lt;br /&gt;
&lt;br /&gt;
== Scrollable area layers ==&lt;br /&gt;
&lt;br /&gt;
There are 2 - and only 2 - places where you should place your HTML stuff in your scrollable area:&lt;br /&gt;
* inside &amp;quot;map_scrollable&amp;quot; div&lt;br /&gt;
* inside &amp;quot;map_scrollable_oversurface&amp;quot; div&lt;br /&gt;
&lt;br /&gt;
The difference is very important: &amp;quot;map_scrollable&amp;quot; is beneath the surface that is used to drag&#039;n&#039;drop the game area, and &amp;quot;map_scrollable_oversurface&amp;quot; is above this surface. In practice:&lt;br /&gt;
* If some element on the game area need to be clicked (or any kind of user interaction), you should place it in map_scrollable_oversurface, otherwise no click can reach it.&lt;br /&gt;
* If some element on the game area don&#039;t need to be clicked, you&#039;d better place it in &amp;quot;map_scrollable&amp;quot;, so it is possible to drag&#039;n&#039;drop the game area from a point on this element.&lt;br /&gt;
&lt;br /&gt;
Of course, all layers are scrolled synchronously.&lt;br /&gt;
&lt;br /&gt;
Tips: in some situation, it&#039;s also useful to place a game element on map_scrollable and a corresponding invisible element over the surface to manage the interactions. Example: when an interactive element must be placed beneath a non interactive element for display reason.&lt;br /&gt;
&lt;br /&gt;
== Positioning elements on game area ==&lt;br /&gt;
&lt;br /&gt;
All elements on the game are must be absolute positioned (with &amp;quot;top&amp;quot; and &amp;quot;left&amp;quot; attributes).&lt;br /&gt;
&lt;br /&gt;
By default, the game area is centered on 0,0 coordinates.&lt;br /&gt;
&lt;br /&gt;
== Enable move arrows ==&lt;br /&gt;
&lt;br /&gt;
To show move arrows icons around the scrollmap in order to enable click based navigation in addition to drag and drop, add these lines to your CSS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/** Move arrows **/&lt;br /&gt;
&lt;br /&gt;
#movetop,#moveleft,#moveright,#movedown {&lt;br /&gt;
    display: block;&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    background-image: url(&#039;../../img/common/arrows.png&#039;);&lt;br /&gt;
    width: 32px;&lt;br /&gt;
    height: 32px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#movetop {&lt;br /&gt;
    top: 0px;&lt;br /&gt;
    left: 50%;&lt;br /&gt;
    background-position: 0px 32px;&lt;br /&gt;
}&lt;br /&gt;
#moveleft {&lt;br /&gt;
    top: 50%;&lt;br /&gt;
    left: 0px;&lt;br /&gt;
    background-position: 32px 0px;&lt;br /&gt;
}&lt;br /&gt;
#moveright {&lt;br /&gt;
    top: 50%;&lt;br /&gt;
    right: 0px;&lt;br /&gt;
    background-position: 0px 0px;&lt;br /&gt;
}&lt;br /&gt;
#movedown {&lt;br /&gt;
    bottom: 0px;&lt;br /&gt;
    left: 50%;&lt;br /&gt;
    background-position: 32px 32px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In your javascript, define the following functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        onMoveTop : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveTop&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( 0, 300 );&lt;br /&gt;
        },&lt;br /&gt;
        onMoveLeft : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveLeft&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( 300, 0 );&lt;br /&gt;
        },&lt;br /&gt;
        onMoveRight : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveRight&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( -300, 0 );&lt;br /&gt;
        },&lt;br /&gt;
        onMoveDown : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveDown&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( 0, -300 );&lt;br /&gt;
        },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And connect onclick events on the arrows to these functions in your javascript setup&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        dojo.connect( $(&#039;movetop&#039;), &#039;onclick&#039;, this, &#039;onMoveTop&#039; );&lt;br /&gt;
        dojo.connect( $(&#039;moveleft&#039;), &#039;onclick&#039;, this, &#039;onMoveLeft&#039; );&lt;br /&gt;
        dojo.connect( $(&#039;moveright&#039;), &#039;onclick&#039;, this, &#039;onMoveRight&#039; );&lt;br /&gt;
        dojo.connect( $(&#039;movedown&#039;), &#039;onclick&#039;, this, &#039;onMoveDown&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Scrollmap&amp;diff=768</id>
		<title>Scrollmap</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Scrollmap&amp;diff=768"/>
		<updated>2013-04-20T16:13:01Z</updated>

		<summary type="html">&lt;p&gt;Een: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scrollmap is a BGA client side component to display an infinite game area.&lt;br /&gt;
&lt;br /&gt;
In some games, players are building the main game area with tiles or cards. Examples:&lt;br /&gt;
* Carcassonne&lt;br /&gt;
* Saboteur&lt;br /&gt;
* Takenoko&lt;br /&gt;
* Taluva&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
Of course this cause an additional difficulty for the adaptation, because we have to display an infinite game area into a finite space on the screen. This is where Scrollmap component can help you.&lt;br /&gt;
&lt;br /&gt;
== Scrollmap in action ==&lt;br /&gt;
&lt;br /&gt;
If you want to see how Scrollmap looks like, please try &amp;quot;Saboteur&amp;quot; or &amp;quot;Takenoko&amp;quot; games on BGA, or watch a game in progress.&lt;br /&gt;
&lt;br /&gt;
In both games, you can see that there are arrow controls around the main game area, so that players can use them to scroll the view. You can also drag&#039;n&#039;drop the game area to scroll.&lt;br /&gt;
&lt;br /&gt;
== How to use Scrollmap ==&lt;br /&gt;
&lt;br /&gt;
At first, don&#039;t forget to add &amp;quot;ebg/scrollmap&amp;quot; as a dependency:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/scrollmap&amp;quot;     /// &amp;lt;==== HERE&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, declare a new variable in your class for the Scrollmap object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        constructor: function(){&lt;br /&gt;
        console.log(&#039;yourgame constructor&#039;);&lt;br /&gt;
              &lt;br /&gt;
        // Scrollable area        	&lt;br /&gt;
        this.scrollmap = new ebg.scrollmap();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, open your template (TPL) file and add this HTML code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;map_container&amp;quot;&amp;gt;&lt;br /&gt;
    	&amp;lt;div id=&amp;quot;map_scrollable&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;map_surface&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;map_scrollable_oversurface&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;movetop&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;moveleft&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;moveright&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;movedown&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are also some lines to add to your CSS stylesheet. Please note that you can adapt it to your needs, especially the default width of the scrollable area:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/** Scrollable area **/&lt;br /&gt;
&lt;br /&gt;
#map_container {&lt;br /&gt;
    position: relative;&lt;br /&gt;
    width: 100%;&lt;br /&gt;
    height: 400px;&lt;br /&gt;
    overflow: hidden;&lt;br /&gt;
}&lt;br /&gt;
#map_scrollable, #map_scrollable_oversurface {&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    top: 205px;&lt;br /&gt;
    left:  315px;&lt;br /&gt;
}&lt;br /&gt;
#map_surface {&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    top: 0px;&lt;br /&gt;
    left: 0px;&lt;br /&gt;
    width: 100%;&lt;br /&gt;
    height: 100%;&lt;br /&gt;
    cursor: move;&lt;br /&gt;
}&lt;br /&gt;
#map_footer {&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, to link your HTML code with your Javascript, place this in your Javascript &amp;quot;Setup&amp;quot; method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   	// Make map scrollable        	&lt;br /&gt;
        this.scrollmap.create( $(&#039;map_container&#039;),$(&#039;map_scrollable&#039;),$(&#039;map_surface&#039;),$(&#039;map_scrollable_oversurface&#039;) );&lt;br /&gt;
        this.scrollmap.setupOnScreenArrows( 150 );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is it! Now, you should see on your game interface a scrollable game area. This is not really impressive though, because you didn&#039;t add anything on the game area yet. This is the next step.&lt;br /&gt;
&lt;br /&gt;
== Scrollable area layers ==&lt;br /&gt;
&lt;br /&gt;
There are 2 - and only 2 - places where you should place your HTML stuff in your scrollable area:&lt;br /&gt;
* inside &amp;quot;map_scrollable&amp;quot; div&lt;br /&gt;
* inside &amp;quot;map_scrollable_oversurface&amp;quot; div&lt;br /&gt;
&lt;br /&gt;
The difference is very important: &amp;quot;map_scrollable&amp;quot; is beneath the surface that is used to drag&#039;n&#039;drop the game area, and &amp;quot;map_scrollable_oversurface&amp;quot; is above this surface. In practice:&lt;br /&gt;
* If some element on the game area need to be clicked (or any kind of user interaction), you should place it in map_scrollable_oversurface, otherwise no click can reach it.&lt;br /&gt;
* If some element on the game area don&#039;t need to be clicked, you&#039;d better place it in &amp;quot;map_scrollable&amp;quot;, so it is possible to drag&#039;n&#039;drop the game area from a point on this element.&lt;br /&gt;
&lt;br /&gt;
Of course, all layers are scrolled synchronously.&lt;br /&gt;
&lt;br /&gt;
Tips: in some situation, it&#039;s also useful to place a game element on map_scrollable and a corresponding invisible element over the surface to manage the interactions. Example: when an interactive element must be placed beneath a non interactive element for display reason.&lt;br /&gt;
&lt;br /&gt;
== Positioning elements on game area ==&lt;br /&gt;
&lt;br /&gt;
All elements on the game are must be absolute positioned (with &amp;quot;top&amp;quot; and &amp;quot;left&amp;quot; attributes).&lt;br /&gt;
&lt;br /&gt;
By default, the game area is centered on 0,0 coordinates.&lt;br /&gt;
&lt;br /&gt;
== Move arrows ==&lt;br /&gt;
&lt;br /&gt;
To show move arrows around the scrollmap to enable click based navigation in addition to drag and drop, add these lines to your CSS&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/** Move arrows **/&lt;br /&gt;
&lt;br /&gt;
#movetop,#moveleft,#moveright,#movedown {&lt;br /&gt;
    display: block;&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    background-image: url(&#039;../../img/common/arrows.png&#039;);&lt;br /&gt;
    width: 32px;&lt;br /&gt;
    height: 32px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#movetop {&lt;br /&gt;
    top: 0px;&lt;br /&gt;
    left: 50%;&lt;br /&gt;
    background-position: 0px 32px;&lt;br /&gt;
}&lt;br /&gt;
#moveleft {&lt;br /&gt;
    top: 50%;&lt;br /&gt;
    left: 0px;&lt;br /&gt;
    background-position: 32px 0px;&lt;br /&gt;
}&lt;br /&gt;
#moveright {&lt;br /&gt;
    top: 50%;&lt;br /&gt;
    right: 0px;&lt;br /&gt;
    background-position: 0px 0px;&lt;br /&gt;
}&lt;br /&gt;
#movedown {&lt;br /&gt;
    bottom: 0px;&lt;br /&gt;
    left: 50%;&lt;br /&gt;
    background-position: 32px 32px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, in your javascript, define the following functions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        onMoveTop : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveTop&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( 0, 300 );&lt;br /&gt;
        },&lt;br /&gt;
        onMoveLeft : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveLeft&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( 300, 0 );&lt;br /&gt;
        },&lt;br /&gt;
        onMoveRight : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveRight&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( -300, 0 );&lt;br /&gt;
        },&lt;br /&gt;
        onMoveDown : function( evt )&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &amp;quot;onMoveDown&amp;quot; );        &lt;br /&gt;
            evt.preventDefault();&lt;br /&gt;
            this.scrollmap.scroll( 0, -300 );&lt;br /&gt;
        },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And connect onclick events on the arrows to these functions in your javascript setup&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            dojo.connect( $(&#039;movetop&#039;), &#039;onclick&#039;, this, &#039;onMoveTop&#039; );&lt;br /&gt;
            dojo.connect( $(&#039;moveleft&#039;), &#039;onclick&#039;, this, &#039;onMoveLeft&#039; );&lt;br /&gt;
            dojo.connect( $(&#039;moveright&#039;), &#039;onclick&#039;, this, &#039;onMoveRight&#039; );&lt;br /&gt;
            dojo.connect( $(&#039;movedown&#039;), &#039;onclick&#039;, this, &#039;onMoveDown&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Scrollmap&amp;diff=767</id>
		<title>Scrollmap</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Scrollmap&amp;diff=767"/>
		<updated>2013-04-20T16:08:47Z</updated>

		<summary type="html">&lt;p&gt;Een: /* How to use Scrollmap */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scrollmap is a BGA client side component to display an infinite game area.&lt;br /&gt;
&lt;br /&gt;
In some games, players are building the main game area with tiles or cards. Examples:&lt;br /&gt;
* Carcassonne&lt;br /&gt;
* Saboteur&lt;br /&gt;
* Takenoko&lt;br /&gt;
* Taluva&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
Of course this cause an additional difficulty for the adaptation, because we have to display an infinite game area into a finite space on the screen. This is where Scrollmap component can help you.&lt;br /&gt;
&lt;br /&gt;
== Scrollmap in action ==&lt;br /&gt;
&lt;br /&gt;
If you want to see how Scrollmap looks like, please try &amp;quot;Saboteur&amp;quot; or &amp;quot;Takenoko&amp;quot; games on BGA, or watch a game in progress.&lt;br /&gt;
&lt;br /&gt;
In both games, you can see that there are arrow controls around the main game area, so that players can use them to scroll the view. You can also drag&#039;n&#039;drop the game area to scroll.&lt;br /&gt;
&lt;br /&gt;
== How to use Scrollmap ==&lt;br /&gt;
&lt;br /&gt;
At first, don&#039;t forget to add &amp;quot;ebg/scrollmap&amp;quot; as a dependency:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/scrollmap&amp;quot;     /// &amp;lt;==== HERE&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, declare a new variable in your class for the Scrollmap object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        constructor: function(){&lt;br /&gt;
        console.log(&#039;yourgame constructor&#039;);&lt;br /&gt;
              &lt;br /&gt;
        // Scrollable area        	&lt;br /&gt;
        this.scrollmap = new ebg.scrollmap();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, open your template (TPL) file and add this HTML code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;map_container&amp;quot;&amp;gt;&lt;br /&gt;
    	&amp;lt;div id=&amp;quot;map_scrollable&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;map_surface&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;map_scrollable_oversurface&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;movetop&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;moveleft&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;moveright&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;movedown&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are also some lines to add to your CSS stylesheet. Please note that you can adapt it to your needs, especially the default width of the scrollable area:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/** Scrollable area **/&lt;br /&gt;
&lt;br /&gt;
#map_container {&lt;br /&gt;
    position: relative;&lt;br /&gt;
    width: 100%;&lt;br /&gt;
    height: 400px;&lt;br /&gt;
    overflow: hidden;&lt;br /&gt;
}&lt;br /&gt;
#map_scrollable, #map_scrollable_oversurface {&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    top: 205px;&lt;br /&gt;
    left:  315px;&lt;br /&gt;
}&lt;br /&gt;
#map_surface {&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    top: 0px;&lt;br /&gt;
    left: 0px;&lt;br /&gt;
    width: 100%;&lt;br /&gt;
    height: 100%;&lt;br /&gt;
    cursor: move;&lt;br /&gt;
}&lt;br /&gt;
#map_footer {&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, to link your HTML code with your Javascript, place this in your Javascript &amp;quot;Setup&amp;quot; method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   	// Make map scrollable        	&lt;br /&gt;
        this.scrollmap.create( $(&#039;map_container&#039;),$(&#039;map_scrollable&#039;),$(&#039;map_surface&#039;),$(&#039;map_scrollable_oversurface&#039;) );&lt;br /&gt;
        this.scrollmap.setupOnScreenArrows( 150 );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is it! Now, you should see on your game interface a scrollable game area. This is not really impressive though, because you didn&#039;t add anything on the game area yet. This is the next step.&lt;br /&gt;
&lt;br /&gt;
== Scrollable area layers ==&lt;br /&gt;
&lt;br /&gt;
There are 2 - and only 2 - places where you should place your HTML stuff in your scrollable area:&lt;br /&gt;
* inside &amp;quot;map_scrollable&amp;quot; div&lt;br /&gt;
* inside &amp;quot;map_scrollable_oversurface&amp;quot; div&lt;br /&gt;
&lt;br /&gt;
The difference is very important: &amp;quot;map_scrollable&amp;quot; is beneath the surface that is used to drag&#039;n&#039;drop the game area, and &amp;quot;map_scrollable_oversurface&amp;quot; is above this surface. In practice:&lt;br /&gt;
* If some element on the game area need to be clicked (or any kind of user interaction), you should place it in map_scrollable_oversurface, otherwise no click can reach it.&lt;br /&gt;
* If some element on the game area don&#039;t need to be clicked, you&#039;d better place it in &amp;quot;map_scrollable&amp;quot;, so it is possible to drag&#039;n&#039;drop the game area from a point on this element.&lt;br /&gt;
&lt;br /&gt;
Of course, all layers are scrolled synchronously.&lt;br /&gt;
&lt;br /&gt;
Tips: in some situation, it&#039;s also useful to place a game element on map_scrollable and a corresponding invisible element over the surface to manage the interactions. Example: when an interactive element must be placed beneath a non interactive element for display reason.&lt;br /&gt;
&lt;br /&gt;
== Positioning elements on game area ==&lt;br /&gt;
&lt;br /&gt;
All elements on the game are must be absolute positioned (with &amp;quot;top&amp;quot; and &amp;quot;left&amp;quot; attributes).&lt;br /&gt;
&lt;br /&gt;
By default, the game area is centered on 0,0 coordinates.&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Scrollmap&amp;diff=766</id>
		<title>Scrollmap</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Scrollmap&amp;diff=766"/>
		<updated>2013-04-20T16:06:32Z</updated>

		<summary type="html">&lt;p&gt;Een: /* How to use Scrollmap */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scrollmap is a BGA client side component to display an infinite game area.&lt;br /&gt;
&lt;br /&gt;
In some games, players are building the main game area with tiles or cards. Examples:&lt;br /&gt;
* Carcassonne&lt;br /&gt;
* Saboteur&lt;br /&gt;
* Takenoko&lt;br /&gt;
* Taluva&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
Of course this cause an additional difficulty for the adaptation, because we have to display an infinite game area into a finite space on the screen. This is where Scrollmap component can help you.&lt;br /&gt;
&lt;br /&gt;
== Scrollmap in action ==&lt;br /&gt;
&lt;br /&gt;
If you want to see how Scrollmap looks like, please try &amp;quot;Saboteur&amp;quot; or &amp;quot;Takenoko&amp;quot; games on BGA, or watch a game in progress.&lt;br /&gt;
&lt;br /&gt;
In both games, you can see that there are arrow controls around the main game area, so that players can use them to scroll the view. You can also drag&#039;n&#039;drop the game area to scroll.&lt;br /&gt;
&lt;br /&gt;
== How to use Scrollmap ==&lt;br /&gt;
&lt;br /&gt;
At first, don&#039;t forget to add &amp;quot;ebg/scrollmap&amp;quot; as a dependency:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/scrollmap&amp;quot;     /// &amp;lt;==== HERE&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, declare a new variable in your class for the Scrollmap object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        constructor: function(){&lt;br /&gt;
        console.log(&#039;yourgame constructor&#039;);&lt;br /&gt;
              &lt;br /&gt;
        // Scrollable area        	&lt;br /&gt;
        this.scrollmap = new ebg.scrollmap();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, open your template (TPL) file and add this HTML code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;map_container&amp;quot;&amp;gt;&lt;br /&gt;
    	&amp;lt;div id=&amp;quot;map_scrollable&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;map_surface&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;map_scrollable_oversurface&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;movetop&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;moveleft&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;moveright&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;a id=&amp;quot;movedown&amp;quot; href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are also some lines to add to your CSS stylesheet. Please note that you can adapt it to your needs, especially the default width of the scrollable area:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/** Scrollable area **/&lt;br /&gt;
&lt;br /&gt;
#map_container {&lt;br /&gt;
    position: relative;&lt;br /&gt;
    width: 100%;&lt;br /&gt;
    height: 400px;&lt;br /&gt;
    overflow: hidden;&lt;br /&gt;
}&lt;br /&gt;
#map_scrollable, #map_scrollable_oversurface {&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    top: 205px;&lt;br /&gt;
    left:  315px;&lt;br /&gt;
}&lt;br /&gt;
#map_surface {&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    top: 0px;&lt;br /&gt;
    left: 0px;&lt;br /&gt;
    width: 100%;&lt;br /&gt;
    height: 100%;&lt;br /&gt;
    cursor: move;&lt;br /&gt;
}&lt;br /&gt;
#map_footer {&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Move arrows **/&lt;br /&gt;
&lt;br /&gt;
#movetop,#moveleft,#moveright,#movedown {&lt;br /&gt;
    display: block;&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    background-image: url(&#039;../../img/common/arrows.png&#039;);&lt;br /&gt;
    width: 32px;&lt;br /&gt;
    height: 32px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#movetop {&lt;br /&gt;
    top: 0px;&lt;br /&gt;
    left: 50%;&lt;br /&gt;
    background-position: 0px 32px;&lt;br /&gt;
}&lt;br /&gt;
#moveleft {&lt;br /&gt;
    top: 50%;&lt;br /&gt;
    left: 0px;&lt;br /&gt;
    background-position: 32px 0px;&lt;br /&gt;
}&lt;br /&gt;
#moveright {&lt;br /&gt;
    top: 50%;&lt;br /&gt;
    right: 0px;&lt;br /&gt;
    background-position: 0px 0px;&lt;br /&gt;
}&lt;br /&gt;
#movedown {&lt;br /&gt;
    bottom: 0px;&lt;br /&gt;
    left: 50%;&lt;br /&gt;
    background-position: 32px 32px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, to link your HTML code with your Javascript, place this in your Javascript &amp;quot;Setup&amp;quot; method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   	// Make map scrollable        	&lt;br /&gt;
        this.scrollmap.create( $(&#039;map_container&#039;),$(&#039;map_scrollable&#039;),$(&#039;map_surface&#039;),$(&#039;map_scrollable_oversurface&#039;) );&lt;br /&gt;
        this.scrollmap.setupOnScreenArrows( 150 );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is it! Now, you should see on your game interface a scrollable game area. This is not really impressive though, because you didn&#039;t add anything on the game area yet. This is the next step.&lt;br /&gt;
&lt;br /&gt;
== Scrollable area layers ==&lt;br /&gt;
&lt;br /&gt;
There are 2 - and only 2 - places where you should place your HTML stuff in your scrollable area:&lt;br /&gt;
* inside &amp;quot;map_scrollable&amp;quot; div&lt;br /&gt;
* inside &amp;quot;map_scrollable_oversurface&amp;quot; div&lt;br /&gt;
&lt;br /&gt;
The difference is very important: &amp;quot;map_scrollable&amp;quot; is beneath the surface that is used to drag&#039;n&#039;drop the game area, and &amp;quot;map_scrollable_oversurface&amp;quot; is above this surface. In practice:&lt;br /&gt;
* If some element on the game area need to be clicked (or any kind of user interaction), you should place it in map_scrollable_oversurface, otherwise no click can reach it.&lt;br /&gt;
* If some element on the game area don&#039;t need to be clicked, you&#039;d better place it in &amp;quot;map_scrollable&amp;quot;, so it is possible to drag&#039;n&#039;drop the game area from a point on this element.&lt;br /&gt;
&lt;br /&gt;
Of course, all layers are scrolled synchronously.&lt;br /&gt;
&lt;br /&gt;
Tips: in some situation, it&#039;s also useful to place a game element on map_scrollable and a corresponding invisible element over the surface to manage the interactions. Example: when an interactive element must be placed beneath a non interactive element for display reason.&lt;br /&gt;
&lt;br /&gt;
== Positioning elements on game area ==&lt;br /&gt;
&lt;br /&gt;
All elements on the game are must be absolute positioned (with &amp;quot;top&amp;quot; and &amp;quot;left&amp;quot; attributes).&lt;br /&gt;
&lt;br /&gt;
By default, the game area is centered on 0,0 coordinates.&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=First_steps_with_BGA_Studio&amp;diff=754</id>
		<title>First steps with BGA Studio</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=First_steps_with_BGA_Studio&amp;diff=754"/>
		<updated>2013-04-13T13:41:24Z</updated>

		<summary type="html">&lt;p&gt;Een: /* That&amp;#039;s all! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Connect to your SFTP folder and to the BGA Studio website == &lt;br /&gt;
&lt;br /&gt;
After your account has been created, you will get by email:&lt;br /&gt;
* the name of the SFTP server to connect to&lt;br /&gt;
* your SFTP login and password&lt;br /&gt;
* ten BGA Studio logins ending with a numeral ranging from 0 to 9 and the password needed to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using this information:&lt;br /&gt;
# Connect to the SFTP server using your SFTP login and password, through your favourite SFTP client software (such as WinSCP for example)&lt;br /&gt;
# Check than in your home folder you have:&lt;br /&gt;
#* One folder for each of the three example games (reversi, hearts, gomoku)&lt;br /&gt;
#* One folder matching the game you will be developing&lt;br /&gt;
#* One &#039;resources.html&#039; file&lt;br /&gt;
# Open the resources.html file, it contains&lt;br /&gt;
#* The URL pointing to the BGA Studio website (protected with an HTTP Basic authentication scheme, the login and password are also referenced in the &#039;resources.html&#039; file&lt;br /&gt;
#* The URL pointing to the BGA Studio backoffice (please note that you must first be logged in on the BGA Studio website to be able to access the backoffice, as the authentication is shared between the two)&lt;br /&gt;
#* The URL pointing to the web administration tool for the BGA Studio database.&lt;br /&gt;
# Click on the URL to the BGA Studio website, enter the HTTP Basic credentials when prompted for them (and have your browser conveniently memorize them for you). Then you get to an home page just like the one of the main BGA website. Enter one of your ten BGA studio logins to connect as a user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Launch your game and check how to update it == &lt;br /&gt;
# Find your game in the &#039;Play now&#039; section and launch a table&lt;br /&gt;
# Use the &#039;I want between X and X&#039; players to tick down the maximum players number to the minimum&lt;br /&gt;
# Click &#039;Express start&#039;: your game launches with the maximum number of players specified. It shows an empty canvas: in the game zone you just have a sentence &#039;This is your game interface. You can edit this HTML in your &amp;quot;.tpl&amp;quot; file.&#039;.&lt;br /&gt;
# Switch to your SFTP home folder, go into your game folder. Edit the game_game.tpl file, and change this sentence to &#039;Hey, this is my first game!&#039;, then save.&lt;br /&gt;
# Go back to your browser and refresh, check that the game zone has updated.&lt;br /&gt;
# Click on the &#039;Exit game&#039; icon on the top right, and in the popup choose &#039;Express game stop&#039;. The game ends automatically and you are brought back to the table screen for this ended game.&lt;br /&gt;
# Switch to your game folder, go into the img folder and overwrite your game_box.png file with another image.&lt;br /&gt;
# Go back to your browser, &#039;&#039;&#039;empty your browser cache&#039;&#039;&#039;, then refresh the page, and check that the game box image has been updated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Commit your changes ==&lt;br /&gt;
&lt;br /&gt;
Committing uploads your changes on our [http://en.wikipedia.org/wiki/Revision_control revision control] system. This is an extra assurance not to lose your code, and to have the possibility (by asking BGA administrators) to get a previous version of your code if you need to backtrack. It also helps us to follow your progress (we get an email when you commit). So you should commit from time to time, when you hit some landmark in your development.&lt;br /&gt;
&lt;br /&gt;
Here is how to go through your first commit:&lt;br /&gt;
# Go back to your browser tab showing the &#039;resources.html&#039; file. Click on the URL pointing to the BGA Studio backoffice (do not log out of the BGA Studio website before doing so, or you will get a &#039;&#039;&#039;Not authorized&#039;&#039;&#039; error message as the authentication is shared);&lt;br /&gt;
# Click on the &#039;Sources&#039; menu entry to show the commit form. Enter your game name (under the same form as the name of your game folder: lowercase, no spaces), enter your commit comment (such as &#039;My first commit&#039;) then hit the &#039;Submit&#039; button;&lt;br /&gt;
# Check the log for errors, it should end with the following lines:&lt;br /&gt;
&lt;br /&gt;
  Transmitting file data .&lt;br /&gt;
  Committed revision #revision number#.&lt;br /&gt;
  HAL says: done.&lt;br /&gt;
&lt;br /&gt;
NB: you should also commit each time you make an change to your gameoptions.inc.php file or to your stats.inc.php file, as an extra deployment action is needed from us for these files to take effect. Please mention in your commit comment that you need us to deploy those files, or send us an email to ask us to do it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== That&#039;s all! ==&lt;br /&gt;
&lt;br /&gt;
Now you know about the basics of updating your game on BGA Studio and testing your changes.&lt;br /&gt;
&lt;br /&gt;
For more information on the specifics of each file, please check out the [[Studio#BGA_Studio_documentation | reference documentation for the framework]].&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=First_steps_with_BGA_Studio&amp;diff=753</id>
		<title>First steps with BGA Studio</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=First_steps_with_BGA_Studio&amp;diff=753"/>
		<updated>2013-04-13T13:41:04Z</updated>

		<summary type="html">&lt;p&gt;Een: /* That&amp;#039;s all for your first steps! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Connect to your SFTP folder and to the BGA Studio website == &lt;br /&gt;
&lt;br /&gt;
After your account has been created, you will get by email:&lt;br /&gt;
* the name of the SFTP server to connect to&lt;br /&gt;
* your SFTP login and password&lt;br /&gt;
* ten BGA Studio logins ending with a numeral ranging from 0 to 9 and the password needed to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using this information:&lt;br /&gt;
# Connect to the SFTP server using your SFTP login and password, through your favourite SFTP client software (such as WinSCP for example)&lt;br /&gt;
# Check than in your home folder you have:&lt;br /&gt;
#* One folder for each of the three example games (reversi, hearts, gomoku)&lt;br /&gt;
#* One folder matching the game you will be developing&lt;br /&gt;
#* One &#039;resources.html&#039; file&lt;br /&gt;
# Open the resources.html file, it contains&lt;br /&gt;
#* The URL pointing to the BGA Studio website (protected with an HTTP Basic authentication scheme, the login and password are also referenced in the &#039;resources.html&#039; file&lt;br /&gt;
#* The URL pointing to the BGA Studio backoffice (please note that you must first be logged in on the BGA Studio website to be able to access the backoffice, as the authentication is shared between the two)&lt;br /&gt;
#* The URL pointing to the web administration tool for the BGA Studio database.&lt;br /&gt;
# Click on the URL to the BGA Studio website, enter the HTTP Basic credentials when prompted for them (and have your browser conveniently memorize them for you). Then you get to an home page just like the one of the main BGA website. Enter one of your ten BGA studio logins to connect as a user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Launch your game and check how to update it == &lt;br /&gt;
# Find your game in the &#039;Play now&#039; section and launch a table&lt;br /&gt;
# Use the &#039;I want between X and X&#039; players to tick down the maximum players number to the minimum&lt;br /&gt;
# Click &#039;Express start&#039;: your game launches with the maximum number of players specified. It shows an empty canvas: in the game zone you just have a sentence &#039;This is your game interface. You can edit this HTML in your &amp;quot;.tpl&amp;quot; file.&#039;.&lt;br /&gt;
# Switch to your SFTP home folder, go into your game folder. Edit the game_game.tpl file, and change this sentence to &#039;Hey, this is my first game!&#039;, then save.&lt;br /&gt;
# Go back to your browser and refresh, check that the game zone has updated.&lt;br /&gt;
# Click on the &#039;Exit game&#039; icon on the top right, and in the popup choose &#039;Express game stop&#039;. The game ends automatically and you are brought back to the table screen for this ended game.&lt;br /&gt;
# Switch to your game folder, go into the img folder and overwrite your game_box.png file with another image.&lt;br /&gt;
# Go back to your browser, &#039;&#039;&#039;empty your browser cache&#039;&#039;&#039;, then refresh the page, and check that the game box image has been updated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Commit your changes ==&lt;br /&gt;
&lt;br /&gt;
Committing uploads your changes on our [http://en.wikipedia.org/wiki/Revision_control revision control] system. This is an extra assurance not to lose your code, and to have the possibility (by asking BGA administrators) to get a previous version of your code if you need to backtrack. It also helps us to follow your progress (we get an email when you commit). So you should commit from time to time, when you hit some landmark in your development.&lt;br /&gt;
&lt;br /&gt;
Here is how to go through your first commit:&lt;br /&gt;
# Go back to your browser tab showing the &#039;resources.html&#039; file. Click on the URL pointing to the BGA Studio backoffice (do not log out of the BGA Studio website before doing so, or you will get a &#039;&#039;&#039;Not authorized&#039;&#039;&#039; error message as the authentication is shared);&lt;br /&gt;
# Click on the &#039;Sources&#039; menu entry to show the commit form. Enter your game name (under the same form as the name of your game folder: lowercase, no spaces), enter your commit comment (such as &#039;My first commit&#039;) then hit the &#039;Submit&#039; button;&lt;br /&gt;
# Check the log for errors, it should end with the following lines:&lt;br /&gt;
&lt;br /&gt;
  Transmitting file data .&lt;br /&gt;
  Committed revision #revision number#.&lt;br /&gt;
  HAL says: done.&lt;br /&gt;
&lt;br /&gt;
NB: you should also commit each time you make an change to your gameoptions.inc.php file or to your stats.inc.php file, as an extra deployment action is needed from us for these files to take effect. Please mention in your commit comment that you need us to deploy those files, or send us an email to ask us to do it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== That&#039;s all! ==&lt;br /&gt;
&lt;br /&gt;
Now you know about the basics of updating your game on the studio and testing your changes.&lt;br /&gt;
&lt;br /&gt;
For more information on the specifics of each file, please check out the [[Studio#BGA_Studio_documentation | reference documentation for the framework]].&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=First_steps_with_BGA_Studio&amp;diff=752</id>
		<title>First steps with BGA Studio</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=First_steps_with_BGA_Studio&amp;diff=752"/>
		<updated>2013-04-13T13:40:33Z</updated>

		<summary type="html">&lt;p&gt;Een: /* Commit your changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Connect to your SFTP folder and to the BGA Studio website == &lt;br /&gt;
&lt;br /&gt;
After your account has been created, you will get by email:&lt;br /&gt;
* the name of the SFTP server to connect to&lt;br /&gt;
* your SFTP login and password&lt;br /&gt;
* ten BGA Studio logins ending with a numeral ranging from 0 to 9 and the password needed to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using this information:&lt;br /&gt;
# Connect to the SFTP server using your SFTP login and password, through your favourite SFTP client software (such as WinSCP for example)&lt;br /&gt;
# Check than in your home folder you have:&lt;br /&gt;
#* One folder for each of the three example games (reversi, hearts, gomoku)&lt;br /&gt;
#* One folder matching the game you will be developing&lt;br /&gt;
#* One &#039;resources.html&#039; file&lt;br /&gt;
# Open the resources.html file, it contains&lt;br /&gt;
#* The URL pointing to the BGA Studio website (protected with an HTTP Basic authentication scheme, the login and password are also referenced in the &#039;resources.html&#039; file&lt;br /&gt;
#* The URL pointing to the BGA Studio backoffice (please note that you must first be logged in on the BGA Studio website to be able to access the backoffice, as the authentication is shared between the two)&lt;br /&gt;
#* The URL pointing to the web administration tool for the BGA Studio database.&lt;br /&gt;
# Click on the URL to the BGA Studio website, enter the HTTP Basic credentials when prompted for them (and have your browser conveniently memorize them for you). Then you get to an home page just like the one of the main BGA website. Enter one of your ten BGA studio logins to connect as a user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Launch your game and check how to update it == &lt;br /&gt;
# Find your game in the &#039;Play now&#039; section and launch a table&lt;br /&gt;
# Use the &#039;I want between X and X&#039; players to tick down the maximum players number to the minimum&lt;br /&gt;
# Click &#039;Express start&#039;: your game launches with the maximum number of players specified. It shows an empty canvas: in the game zone you just have a sentence &#039;This is your game interface. You can edit this HTML in your &amp;quot;.tpl&amp;quot; file.&#039;.&lt;br /&gt;
# Switch to your SFTP home folder, go into your game folder. Edit the game_game.tpl file, and change this sentence to &#039;Hey, this is my first game!&#039;, then save.&lt;br /&gt;
# Go back to your browser and refresh, check that the game zone has updated.&lt;br /&gt;
# Click on the &#039;Exit game&#039; icon on the top right, and in the popup choose &#039;Express game stop&#039;. The game ends automatically and you are brought back to the table screen for this ended game.&lt;br /&gt;
# Switch to your game folder, go into the img folder and overwrite your game_box.png file with another image.&lt;br /&gt;
# Go back to your browser, &#039;&#039;&#039;empty your browser cache&#039;&#039;&#039;, then refresh the page, and check that the game box image has been updated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Commit your changes ==&lt;br /&gt;
&lt;br /&gt;
Committing uploads your changes on our [http://en.wikipedia.org/wiki/Revision_control revision control] system. This is an extra assurance not to lose your code, and to have the possibility (by asking BGA administrators) to get a previous version of your code if you need to backtrack. It also helps us to follow your progress (we get an email when you commit). So you should commit from time to time, when you hit some landmark in your development.&lt;br /&gt;
&lt;br /&gt;
Here is how to go through your first commit:&lt;br /&gt;
# Go back to your browser tab showing the &#039;resources.html&#039; file. Click on the URL pointing to the BGA Studio backoffice (do not log out of the BGA Studio website before doing so, or you will get a &#039;&#039;&#039;Not authorized&#039;&#039;&#039; error message as the authentication is shared);&lt;br /&gt;
# Click on the &#039;Sources&#039; menu entry to show the commit form. Enter your game name (under the same form as the name of your game folder: lowercase, no spaces), enter your commit comment (such as &#039;My first commit&#039;) then hit the &#039;Submit&#039; button;&lt;br /&gt;
# Check the log for errors, it should end with the following lines:&lt;br /&gt;
&lt;br /&gt;
  Transmitting file data .&lt;br /&gt;
  Committed revision #revision number#.&lt;br /&gt;
  HAL says: done.&lt;br /&gt;
&lt;br /&gt;
NB: you should also commit each time you make an change to your gameoptions.inc.php file or to your stats.inc.php file, as an extra deployment action is needed from us for these files to take effect. Please mention in your commit comment that you need us to deploy those files, or send us an email to ask us to do it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== That&#039;s all for your first steps! ==&lt;br /&gt;
&lt;br /&gt;
Now you know about the basics of updating your game on the studio and testing your changes.&lt;br /&gt;
&lt;br /&gt;
For more information on the specifics of each file, please check out the [[Studio#BGA_Studio_documentation | reference documentation for the framework]].&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Studio&amp;diff=751</id>
		<title>Studio</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Studio&amp;diff=751"/>
		<updated>2013-04-13T13:38:56Z</updated>

		<summary type="html">&lt;p&gt;Een: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Bga_studio_small.jpg]]&lt;br /&gt;
&lt;br /&gt;
Note: Please DO NOT translate Studio Documentation, so that there can be one place where you can find the latest information available.&lt;br /&gt;
&lt;br /&gt;
== What is Board Game Arena Studio? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Game Arena Studio&#039;&#039;&#039; is a platform to build online board game adaptation using the Board Game Arena platform.&lt;br /&gt;
&lt;br /&gt;
It is open to any gamer with development skills :)&lt;br /&gt;
&lt;br /&gt;
See announcement here:&lt;br /&gt;
http://forum.boardgamearena.com/viewtopic.php?f=10&amp;amp;t=1973&lt;br /&gt;
&lt;br /&gt;
== Discover BGA Studio in 5 presentations ==&lt;br /&gt;
&lt;br /&gt;
Why, how, what... to start discovering BGA Studio, we prepared 5 &amp;quot;powerpoint&amp;quot; presentations for you:&lt;br /&gt;
&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/5-reasons-why-you-should-use-bga-studio-for-your-online-board-game 5 reasons why you should use BGA Studio for your online board game]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/the-8-steps-to-create-a-board-game-on-board-game-arena The 8 steps to create a board game on Board Game Arena]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/the-bga-framework-at-a-glance The BGA Framework at a glance]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/bga-studio-focus-on-bga-game-state-machine Focus on BGA game state machine]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/bga-studio-guidelines BGA developers guidelines]&lt;br /&gt;
&lt;br /&gt;
== How to join the BGA developer team? ==&lt;br /&gt;
&lt;br /&gt;
Please see this page: [[How to join BGA developer team?]]&lt;br /&gt;
&lt;br /&gt;
== Great, I&#039;m in! ... How should I start? ==&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t already, check the presentations at the top of this page to get the basics.&lt;br /&gt;
&lt;br /&gt;
Then, you should checkout the [[First steps with BGA Studio]] to make sure that runs fine.&lt;br /&gt;
&lt;br /&gt;
After that, we advise you to take a peek at one or both of these two game creation tutorials:&lt;br /&gt;
* [[Tutorial reversi]]&lt;br /&gt;
* [[Tutorial gomoku]]&lt;br /&gt;
&lt;br /&gt;
Then start editing files and see what happens! ;)&lt;br /&gt;
&lt;br /&gt;
If you have any questions, please check out the &#039;&#039;&#039;[[Studio FAQ]]&#039;&#039;&#039; first, then if you didn&#039;t find the answer you were looking for, please post your question on the [http://forum.boardgamearena.com/viewforum.php?f=12 &#039;&#039;&#039;development forum&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
== BGA Studio documentation ==&lt;br /&gt;
&lt;br /&gt;
=== BGA Studio Framework reference ===&lt;br /&gt;
&lt;br /&gt;
This part of the documentation focuses on the development framework itself: functions and methods available to build your game.&lt;br /&gt;
&lt;br /&gt;
[[Studio file reference|File structure of a BGA game]]&lt;br /&gt;
&lt;br /&gt;
==== Game logic ====&lt;br /&gt;
&lt;br /&gt;
* [[Main game logic: yourgamename.game.php]]&lt;br /&gt;
* [[Your game state machine: states.inc.php]]&lt;br /&gt;
* [[Game database model: dbmodel.sql]]&lt;br /&gt;
* [[Players actions: yourgamename.action.php]]&lt;br /&gt;
* [[Game material description: material.inc.php]]&lt;br /&gt;
* [[Game statistics: stats.inc.php]]&lt;br /&gt;
&lt;br /&gt;
==== Game interface ====&lt;br /&gt;
&lt;br /&gt;
* [[Game interface logic: yourgamename.js]]&lt;br /&gt;
* [[Game art: img directory]]&lt;br /&gt;
* [[Game interface stylesheet: yourgamename.css]]&lt;br /&gt;
* [[Game layout: view and template: yourgamename.view.php and yourgamename_yourgamename.tpl]]&lt;br /&gt;
&lt;br /&gt;
==== Other components ====&lt;br /&gt;
&lt;br /&gt;
* [[Translations]] (how to make your game translatable)&lt;br /&gt;
* [[Game options and preferences: gameoptions.inc.php]]&lt;br /&gt;
* [[Game replay]]&lt;br /&gt;
&lt;br /&gt;
=== BGA Studio game components reference ===&lt;br /&gt;
&lt;br /&gt;
Game components are useful tools you can use in your game adaptations.&lt;br /&gt;
&lt;br /&gt;
* [[Deck]]: a PHP component to manage cards (deck, hands, picking cards, moving cards, shuffle deck, ...).&lt;br /&gt;
* [[Counter]]: a JS component to manage a counter that can increase/decrease (ex: player&#039;s score).&lt;br /&gt;
* [[Draggable]]: a JS component to manage drag&#039;n&#039;drop actions.&lt;br /&gt;
* [[ExpandableSection]]: a JS component to manage a rectangular block of HTML than can be displayed/hidden.&lt;br /&gt;
* [[Scrollmap]]: a JS component to manage a scrollable game area (useful when the game area can be infinite. Examples:  Saboteur or Takenoko games).&lt;br /&gt;
* [[Stock]]: a JS component to manage and display a set of game elements displayed at a position.&lt;br /&gt;
* [[Wrapper]]: a JS component to wrap a  &amp;amp;lt;div&amp;amp;gt; element around his child, even if these elements are absolute positioned.&lt;br /&gt;
* [[Zone]]: a JS component to manage a zone of the board where several game elements can come and leave, but should be well displayed together (See for example: token&#039;s places at Can&#039;t Stop).&lt;br /&gt;
&lt;br /&gt;
=== BGA Studio user guide ===&lt;br /&gt;
&lt;br /&gt;
This part of the documentation is a user guide for the BGA Studio online development environment.&lt;br /&gt;
&lt;br /&gt;
* [[Tools and tips of BGA Studio]]&lt;br /&gt;
&lt;br /&gt;
* [[Practical debugging]]&lt;br /&gt;
&lt;br /&gt;
* [[Studio back-office]]&lt;br /&gt;
&lt;br /&gt;
* [[Studio FAQ]]&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
&lt;br /&gt;
[http://forum.boardgamearena.com/viewforum.php?f=12 Development forum]&lt;br /&gt;
&lt;br /&gt;
[http://forum.boardgamearena.com/viewforum.php?f=4 Bugs forum]&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Studio&amp;diff=750</id>
		<title>Studio</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Studio&amp;diff=750"/>
		<updated>2013-04-13T13:38:25Z</updated>

		<summary type="html">&lt;p&gt;Een: /* BGA Studio user guide */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Bga_studio_small.jpg]]&lt;br /&gt;
&lt;br /&gt;
Note: Please DO NOT translate Studio Documentation, so that there can be one place where you can find the last information available.&lt;br /&gt;
&lt;br /&gt;
== What is Board Game Arena Studio? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Game Arena Studio&#039;&#039;&#039; is a platform to build online board game adaptation using the Board Game Arena platform.&lt;br /&gt;
&lt;br /&gt;
It is open to any gamer with development skills :)&lt;br /&gt;
&lt;br /&gt;
See announcement here:&lt;br /&gt;
http://forum.boardgamearena.com/viewtopic.php?f=10&amp;amp;t=1973&lt;br /&gt;
&lt;br /&gt;
== Discover BGA Studio in 5 presentations ==&lt;br /&gt;
&lt;br /&gt;
Why, how, what... to start discovering BGA Studio, we prepared 5 &amp;quot;powerpoint&amp;quot; presentations for you:&lt;br /&gt;
&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/5-reasons-why-you-should-use-bga-studio-for-your-online-board-game 5 reasons why you should use BGA Studio for your online board game]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/the-8-steps-to-create-a-board-game-on-board-game-arena The 8 steps to create a board game on Board Game Arena]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/the-bga-framework-at-a-glance The BGA Framework at a glance]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/bga-studio-focus-on-bga-game-state-machine Focus on BGA game state machine]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/bga-studio-guidelines BGA developers guidelines]&lt;br /&gt;
&lt;br /&gt;
== How to join the BGA developer team? ==&lt;br /&gt;
&lt;br /&gt;
Please see this page: [[How to join BGA developer team?]]&lt;br /&gt;
&lt;br /&gt;
== Great, I&#039;m in! ... How should I start? ==&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t already, check the presentations at the top of this page to get the basics.&lt;br /&gt;
&lt;br /&gt;
Then, you should checkout the [[First steps with BGA Studio]] to make sure that runs fine.&lt;br /&gt;
&lt;br /&gt;
After that, we advise you to take a peek at one or both of these two game creation tutorials:&lt;br /&gt;
* [[Tutorial reversi]]&lt;br /&gt;
* [[Tutorial gomoku]]&lt;br /&gt;
&lt;br /&gt;
Then start editing files and see what happens! ;)&lt;br /&gt;
&lt;br /&gt;
If you have any questions, please check out the &#039;&#039;&#039;[[Studio FAQ]]&#039;&#039;&#039; first, then if you didn&#039;t find the answer you were looking for, please post your question on the [http://forum.boardgamearena.com/viewforum.php?f=12 &#039;&#039;&#039;development forum&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
== BGA Studio documentation ==&lt;br /&gt;
&lt;br /&gt;
=== BGA Studio Framework reference ===&lt;br /&gt;
&lt;br /&gt;
This part of the documentation focuses on the development framework itself: functions and methods available to build your game.&lt;br /&gt;
&lt;br /&gt;
[[Studio file reference|File structure of a BGA game]]&lt;br /&gt;
&lt;br /&gt;
==== Game logic ====&lt;br /&gt;
&lt;br /&gt;
* [[Main game logic: yourgamename.game.php]]&lt;br /&gt;
* [[Your game state machine: states.inc.php]]&lt;br /&gt;
* [[Game database model: dbmodel.sql]]&lt;br /&gt;
* [[Players actions: yourgamename.action.php]]&lt;br /&gt;
* [[Game material description: material.inc.php]]&lt;br /&gt;
* [[Game statistics: stats.inc.php]]&lt;br /&gt;
&lt;br /&gt;
==== Game interface ====&lt;br /&gt;
&lt;br /&gt;
* [[Game interface logic: yourgamename.js]]&lt;br /&gt;
* [[Game art: img directory]]&lt;br /&gt;
* [[Game interface stylesheet: yourgamename.css]]&lt;br /&gt;
* [[Game layout: view and template: yourgamename.view.php and yourgamename_yourgamename.tpl]]&lt;br /&gt;
&lt;br /&gt;
==== Other components ====&lt;br /&gt;
&lt;br /&gt;
* [[Translations]] (how to make your game translatable)&lt;br /&gt;
* [[Game options and preferences: gameoptions.inc.php]]&lt;br /&gt;
* [[Game replay]]&lt;br /&gt;
&lt;br /&gt;
=== BGA Studio game components reference ===&lt;br /&gt;
&lt;br /&gt;
Game components are useful tools you can use in your game adaptations.&lt;br /&gt;
&lt;br /&gt;
* [[Deck]]: a PHP component to manage cards (deck, hands, picking cards, moving cards, shuffle deck, ...).&lt;br /&gt;
* [[Counter]]: a JS component to manage a counter that can increase/decrease (ex: player&#039;s score).&lt;br /&gt;
* [[Draggable]]: a JS component to manage drag&#039;n&#039;drop actions.&lt;br /&gt;
* [[ExpandableSection]]: a JS component to manage a rectangular block of HTML than can be displayed/hidden.&lt;br /&gt;
* [[Scrollmap]]: a JS component to manage a scrollable game area (useful when the game area can be infinite. Examples:  Saboteur or Takenoko games).&lt;br /&gt;
* [[Stock]]: a JS component to manage and display a set of game elements displayed at a position.&lt;br /&gt;
* [[Wrapper]]: a JS component to wrap a  &amp;amp;lt;div&amp;amp;gt; element around his child, even if these elements are absolute positioned.&lt;br /&gt;
* [[Zone]]: a JS component to manage a zone of the board where several game elements can come and leave, but should be well displayed together (See for example: token&#039;s places at Can&#039;t Stop).&lt;br /&gt;
&lt;br /&gt;
=== BGA Studio user guide ===&lt;br /&gt;
&lt;br /&gt;
This part of the documentation is a user guide for the BGA Studio online development environment.&lt;br /&gt;
&lt;br /&gt;
* [[Tools and tips of BGA Studio]]&lt;br /&gt;
&lt;br /&gt;
* [[Practical debugging]]&lt;br /&gt;
&lt;br /&gt;
* [[Studio back-office]]&lt;br /&gt;
&lt;br /&gt;
* [[Studio FAQ]]&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
&lt;br /&gt;
[http://forum.boardgamearena.com/viewforum.php?f=12 Development forum]&lt;br /&gt;
&lt;br /&gt;
[http://forum.boardgamearena.com/viewforum.php?f=4 Bugs forum]&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Studio&amp;diff=749</id>
		<title>Studio</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Studio&amp;diff=749"/>
		<updated>2013-04-13T13:38:01Z</updated>

		<summary type="html">&lt;p&gt;Een: /* BGA Studio documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Bga_studio_small.jpg]]&lt;br /&gt;
&lt;br /&gt;
Note: Please DO NOT translate Studio Documentation, so that there can be one place where you can find the last information available.&lt;br /&gt;
&lt;br /&gt;
== What is Board Game Arena Studio? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Game Arena Studio&#039;&#039;&#039; is a platform to build online board game adaptation using the Board Game Arena platform.&lt;br /&gt;
&lt;br /&gt;
It is open to any gamer with development skills :)&lt;br /&gt;
&lt;br /&gt;
See announcement here:&lt;br /&gt;
http://forum.boardgamearena.com/viewtopic.php?f=10&amp;amp;t=1973&lt;br /&gt;
&lt;br /&gt;
== Discover BGA Studio in 5 presentations ==&lt;br /&gt;
&lt;br /&gt;
Why, how, what... to start discovering BGA Studio, we prepared 5 &amp;quot;powerpoint&amp;quot; presentations for you:&lt;br /&gt;
&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/5-reasons-why-you-should-use-bga-studio-for-your-online-board-game 5 reasons why you should use BGA Studio for your online board game]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/the-8-steps-to-create-a-board-game-on-board-game-arena The 8 steps to create a board game on Board Game Arena]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/the-bga-framework-at-a-glance The BGA Framework at a glance]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/bga-studio-focus-on-bga-game-state-machine Focus on BGA game state machine]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/bga-studio-guidelines BGA developers guidelines]&lt;br /&gt;
&lt;br /&gt;
== How to join the BGA developer team? ==&lt;br /&gt;
&lt;br /&gt;
Please see this page: [[How to join BGA developer team?]]&lt;br /&gt;
&lt;br /&gt;
== Great, I&#039;m in! ... How should I start? ==&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t already, check the presentations at the top of this page to get the basics.&lt;br /&gt;
&lt;br /&gt;
Then, you should checkout the [[First steps with BGA Studio]] to make sure that runs fine.&lt;br /&gt;
&lt;br /&gt;
After that, we advise you to take a peek at one or both of these two game creation tutorials:&lt;br /&gt;
* [[Tutorial reversi]]&lt;br /&gt;
* [[Tutorial gomoku]]&lt;br /&gt;
&lt;br /&gt;
Then start editing files and see what happens! ;)&lt;br /&gt;
&lt;br /&gt;
If you have any questions, please check out the &#039;&#039;&#039;[[Studio FAQ]]&#039;&#039;&#039; first, then if you didn&#039;t find the answer you were looking for, please post your question on the [http://forum.boardgamearena.com/viewforum.php?f=12 &#039;&#039;&#039;development forum&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
== BGA Studio documentation ==&lt;br /&gt;
&lt;br /&gt;
=== BGA Studio Framework reference ===&lt;br /&gt;
&lt;br /&gt;
This part of the documentation focuses on the development framework itself: functions and methods available to build your game.&lt;br /&gt;
&lt;br /&gt;
[[Studio file reference|File structure of a BGA game]]&lt;br /&gt;
&lt;br /&gt;
==== Game logic ====&lt;br /&gt;
&lt;br /&gt;
* [[Main game logic: yourgamename.game.php]]&lt;br /&gt;
* [[Your game state machine: states.inc.php]]&lt;br /&gt;
* [[Game database model: dbmodel.sql]]&lt;br /&gt;
* [[Players actions: yourgamename.action.php]]&lt;br /&gt;
* [[Game material description: material.inc.php]]&lt;br /&gt;
* [[Game statistics: stats.inc.php]]&lt;br /&gt;
&lt;br /&gt;
==== Game interface ====&lt;br /&gt;
&lt;br /&gt;
* [[Game interface logic: yourgamename.js]]&lt;br /&gt;
* [[Game art: img directory]]&lt;br /&gt;
* [[Game interface stylesheet: yourgamename.css]]&lt;br /&gt;
* [[Game layout: view and template: yourgamename.view.php and yourgamename_yourgamename.tpl]]&lt;br /&gt;
&lt;br /&gt;
==== Other components ====&lt;br /&gt;
&lt;br /&gt;
* [[Translations]] (how to make your game translatable)&lt;br /&gt;
* [[Game options and preferences: gameoptions.inc.php]]&lt;br /&gt;
* [[Game replay]]&lt;br /&gt;
&lt;br /&gt;
=== BGA Studio game components reference ===&lt;br /&gt;
&lt;br /&gt;
Game components are useful tools you can use in your game adaptations.&lt;br /&gt;
&lt;br /&gt;
* [[Deck]]: a PHP component to manage cards (deck, hands, picking cards, moving cards, shuffle deck, ...).&lt;br /&gt;
* [[Counter]]: a JS component to manage a counter that can increase/decrease (ex: player&#039;s score).&lt;br /&gt;
* [[Draggable]]: a JS component to manage drag&#039;n&#039;drop actions.&lt;br /&gt;
* [[ExpandableSection]]: a JS component to manage a rectangular block of HTML than can be displayed/hidden.&lt;br /&gt;
* [[Scrollmap]]: a JS component to manage a scrollable game area (useful when the game area can be infinite. Examples:  Saboteur or Takenoko games).&lt;br /&gt;
* [[Stock]]: a JS component to manage and display a set of game elements displayed at a position.&lt;br /&gt;
* [[Wrapper]]: a JS component to wrap a  &amp;amp;lt;div&amp;amp;gt; element around his child, even if these elements are absolute positioned.&lt;br /&gt;
* [[Zone]]: a JS component to manage a zone of the board where several game elements can come and leave, but should be well displayed together (See for example: token&#039;s places at Can&#039;t Stop).&lt;br /&gt;
&lt;br /&gt;
== BGA Studio user guide ==&lt;br /&gt;
&lt;br /&gt;
This part of the documentation is a user guide for the BGA Studio online development environment.&lt;br /&gt;
&lt;br /&gt;
* [[Tools and tips of BGA Studio]]&lt;br /&gt;
&lt;br /&gt;
* [[Practical debugging]]&lt;br /&gt;
&lt;br /&gt;
* [[Studio back-office]]&lt;br /&gt;
&lt;br /&gt;
* [[Studio FAQ]]&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
&lt;br /&gt;
[http://forum.boardgamearena.com/viewforum.php?f=12 Development forum]&lt;br /&gt;
&lt;br /&gt;
[http://forum.boardgamearena.com/viewforum.php?f=4 Bugs forum]&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=First_steps_with_BGA_Studio&amp;diff=748</id>
		<title>First steps with BGA Studio</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=First_steps_with_BGA_Studio&amp;diff=748"/>
		<updated>2013-04-13T13:11:19Z</updated>

		<summary type="html">&lt;p&gt;Een: Created page with &amp;quot;== Connect to your SFTP folder and to the BGA Studio website ==   After your account has been created, you will get by email: * the name of the SFTP server to connect to * you...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Connect to your SFTP folder and to the BGA Studio website == &lt;br /&gt;
&lt;br /&gt;
After your account has been created, you will get by email:&lt;br /&gt;
* the name of the SFTP server to connect to&lt;br /&gt;
* your SFTP login and password&lt;br /&gt;
* ten BGA Studio logins ending with a numeral ranging from 0 to 9 and the password needed to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using this information:&lt;br /&gt;
# Connect to the SFTP server using your SFTP login and password, through your favourite SFTP client software (such as WinSCP for example)&lt;br /&gt;
# Check than in your home folder you have:&lt;br /&gt;
#* One folder for each of the three example games (reversi, hearts, gomoku)&lt;br /&gt;
#* One folder matching the game you will be developing&lt;br /&gt;
#* One &#039;resources.html&#039; file&lt;br /&gt;
# Open the resources.html file, it contains&lt;br /&gt;
#* The URL pointing to the BGA Studio website (protected with an HTTP Basic authentication scheme, the login and password are also referenced in the &#039;resources.html&#039; file&lt;br /&gt;
#* The URL pointing to the BGA Studio backoffice (please note that you must first be logged in on the BGA Studio website to be able to access the backoffice, as the authentication is shared between the two)&lt;br /&gt;
#* The URL pointing to the web administration tool for the BGA Studio database.&lt;br /&gt;
# Click on the URL to the BGA Studio website, enter the HTTP Basic credentials when prompted for them (and have your browser conveniently memorize them for you). Then you get to an home page just like the one of the main BGA website. Enter one of your ten BGA studio logins to connect as a user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Launch your game and check how to update it == &lt;br /&gt;
# Find your game in the &#039;Play now&#039; section and launch a table&lt;br /&gt;
# Use the &#039;I want between X and X&#039; players to tick down the maximum players number to the minimum&lt;br /&gt;
# Click &#039;Express start&#039;: your game launches with the maximum number of players specified. It shows an empty canvas: in the game zone you just have a sentence &#039;This is your game interface. You can edit this HTML in your &amp;quot;.tpl&amp;quot; file.&#039;.&lt;br /&gt;
# Switch to your SFTP home folder, go into your game folder. Edit the game_game.tpl file, and change this sentence to &#039;Hey, this is my first game!&#039;, then save.&lt;br /&gt;
# Go back to your browser and refresh, check that the game zone has updated.&lt;br /&gt;
# Click on the &#039;Exit game&#039; icon on the top right, and in the popup choose &#039;Express game stop&#039;. The game ends automatically and you are brought back to the table screen for this ended game.&lt;br /&gt;
# Switch to your game folder, go into the img folder and overwrite your game_box.png file with another image.&lt;br /&gt;
# Go back to your browser, &#039;&#039;&#039;empty your browser cache&#039;&#039;&#039;, then refresh the page, and check that the game box image has been updated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Commit your changes ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&#039;s all! Now you know about the basics of updating your game on the studio and testing your changes!&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Studio&amp;diff=747</id>
		<title>Studio</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Studio&amp;diff=747"/>
		<updated>2013-04-13T12:36:20Z</updated>

		<summary type="html">&lt;p&gt;Een: /* BGA Studio user guide */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Bga_studio_small.jpg]]&lt;br /&gt;
&lt;br /&gt;
Note: Please DO NOT translate Studio Documentation, so that there can be one place where you can find the last information available.&lt;br /&gt;
&lt;br /&gt;
== What is Board Game Arena Studio? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Game Arena Studio&#039;&#039;&#039; is a platform to build online board game adaptation using the Board Game Arena platform.&lt;br /&gt;
&lt;br /&gt;
It is open to any gamer with development skills :)&lt;br /&gt;
&lt;br /&gt;
See announcement here:&lt;br /&gt;
http://forum.boardgamearena.com/viewtopic.php?f=10&amp;amp;t=1973&lt;br /&gt;
&lt;br /&gt;
== Discover BGA Studio in 5 presentations ==&lt;br /&gt;
&lt;br /&gt;
Why, how, what... to start discovering BGA Studio, we prepared 5 &amp;quot;powerpoint&amp;quot; presentations for you:&lt;br /&gt;
&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/5-reasons-why-you-should-use-bga-studio-for-your-online-board-game 5 reasons why you should use BGA Studio for your online board game]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/the-8-steps-to-create-a-board-game-on-board-game-arena The 8 steps to create a board game on Board Game Arena]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/the-bga-framework-at-a-glance The BGA Framework at a glance]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/bga-studio-focus-on-bga-game-state-machine Focus on BGA game state machine]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/bga-studio-guidelines BGA developers guidelines]&lt;br /&gt;
&lt;br /&gt;
== How to join the BGA developer team? ==&lt;br /&gt;
&lt;br /&gt;
Please see this page: [[How to join BGA developer team?]]&lt;br /&gt;
&lt;br /&gt;
== Great, I&#039;m in! ... How should I start? ==&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t already, check the presentations at the top of this page to get the basics.&lt;br /&gt;
&lt;br /&gt;
Then, you should checkout the [[First steps with BGA Studio]] to make sure that runs fine.&lt;br /&gt;
&lt;br /&gt;
After that, we advise you to take a peek at one or both of these two game creation tutorials:&lt;br /&gt;
* [[Tutorial reversi]]&lt;br /&gt;
* [[Tutorial gomoku]]&lt;br /&gt;
&lt;br /&gt;
Then start editing files and see what happens! ;)&lt;br /&gt;
&lt;br /&gt;
If you have any questions, please check out the &#039;&#039;&#039;[[Studio FAQ]]&#039;&#039;&#039; first, then if you didn&#039;t find the answer you were looking for, please post your question on the [http://forum.boardgamearena.com/viewforum.php?f=12 &#039;&#039;&#039;development forum&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
== BGA Studio documentation ==&lt;br /&gt;
&lt;br /&gt;
=== BGA Studio Framework reference ===&lt;br /&gt;
&lt;br /&gt;
This part of the documentation focus on the development framework itself: functions and methods available to build your game.&lt;br /&gt;
&lt;br /&gt;
[[Studio file reference|File structure of a BGA game]]&lt;br /&gt;
&lt;br /&gt;
==== Game logic ====&lt;br /&gt;
&lt;br /&gt;
* [[Main game logic: yourgamename.game.php]]&lt;br /&gt;
* [[Your game state machine: states.inc.php]]&lt;br /&gt;
* [[Game database model: dbmodel.sql]]&lt;br /&gt;
* [[Players actions: yourgamename.action.php]]&lt;br /&gt;
* [[Game material description: material.inc.php]]&lt;br /&gt;
* [[Game statistics: stats.inc.php]]&lt;br /&gt;
&lt;br /&gt;
==== Game interface ====&lt;br /&gt;
&lt;br /&gt;
* [[Game interface logic: yourgamename.js]]&lt;br /&gt;
* [[Game art: img directory]]&lt;br /&gt;
* [[Game interface stylesheet: yourgamename.css]]&lt;br /&gt;
* [[Game layout: view and template: yourgamename.view.php and yourgamename_yourgamename.tpl]]&lt;br /&gt;
&lt;br /&gt;
==== Other components ====&lt;br /&gt;
&lt;br /&gt;
* [[Translations]] (how to make your game translatable)&lt;br /&gt;
* [[Game options and preferences: gameoptions.inc.php]]&lt;br /&gt;
* [[Game replay]]&lt;br /&gt;
&lt;br /&gt;
=== BGA Studio game components reference ===&lt;br /&gt;
&lt;br /&gt;
Game components are useful tools you can use in your game adaptations.&lt;br /&gt;
&lt;br /&gt;
* [[Deck]]: a PHP component to manage cards (deck, hands, picking cards, moving cards, shuffle deck, ...).&lt;br /&gt;
* [[Counter]]: a JS component to manage a counter that can increase/decrease (ex: player&#039;s score).&lt;br /&gt;
* [[Draggable]]: a JS component to manage drag&#039;n&#039;drop actions.&lt;br /&gt;
* [[ExpandableSection]]: a JS component to manage a rectangular block of HTML than can be displayed/hidden.&lt;br /&gt;
* [[Scrollmap]]: a JS component to manage a scrollable game area (useful when the game area can be infinite. Examples:  Saboteur or Takenoko games).&lt;br /&gt;
* [[Stock]]: a JS component to manage and display a set of game elements displayed at a position.&lt;br /&gt;
* [[Wrapper]]: a JS component to wrap a  &amp;amp;lt;div&amp;amp;gt; element around his child, even if these elements are absolute positioned.&lt;br /&gt;
* [[Zone]]: a JS component to manage a zone of the board where several game elements can come and leave, but should be well displayed together (See for example: token&#039;s places at Can&#039;t Stop).&lt;br /&gt;
&lt;br /&gt;
== BGA Studio user guide ==&lt;br /&gt;
&lt;br /&gt;
This part of the documentation is a user guide for the BGA Studio online development environment.&lt;br /&gt;
&lt;br /&gt;
* [[Tools and tips of BGA Studio]]&lt;br /&gt;
&lt;br /&gt;
* [[Practical debugging]]&lt;br /&gt;
&lt;br /&gt;
* [[Studio back-office]]&lt;br /&gt;
&lt;br /&gt;
* [[Studio FAQ]]&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
&lt;br /&gt;
[http://forum.boardgamearena.com/viewforum.php?f=12 Development forum]&lt;br /&gt;
&lt;br /&gt;
[http://forum.boardgamearena.com/viewforum.php?f=4 Bugs forum]&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
	<entry>
		<id>https://ko.doc.boardgamearena.com/index.php?title=Studio&amp;diff=746</id>
		<title>Studio</title>
		<link rel="alternate" type="text/html" href="https://ko.doc.boardgamearena.com/index.php?title=Studio&amp;diff=746"/>
		<updated>2013-04-13T12:35:51Z</updated>

		<summary type="html">&lt;p&gt;Een: /* BGA Studio user guide */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Bga_studio_small.jpg]]&lt;br /&gt;
&lt;br /&gt;
Note: Please DO NOT translate Studio Documentation, so that there can be one place where you can find the last information available.&lt;br /&gt;
&lt;br /&gt;
== What is Board Game Arena Studio? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Game Arena Studio&#039;&#039;&#039; is a platform to build online board game adaptation using the Board Game Arena platform.&lt;br /&gt;
&lt;br /&gt;
It is open to any gamer with development skills :)&lt;br /&gt;
&lt;br /&gt;
See announcement here:&lt;br /&gt;
http://forum.boardgamearena.com/viewtopic.php?f=10&amp;amp;t=1973&lt;br /&gt;
&lt;br /&gt;
== Discover BGA Studio in 5 presentations ==&lt;br /&gt;
&lt;br /&gt;
Why, how, what... to start discovering BGA Studio, we prepared 5 &amp;quot;powerpoint&amp;quot; presentations for you:&lt;br /&gt;
&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/5-reasons-why-you-should-use-bga-studio-for-your-online-board-game 5 reasons why you should use BGA Studio for your online board game]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/the-8-steps-to-create-a-board-game-on-board-game-arena The 8 steps to create a board game on Board Game Arena]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/the-bga-framework-at-a-glance The BGA Framework at a glance]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/bga-studio-focus-on-bga-game-state-machine Focus on BGA game state machine]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/bga-studio-guidelines BGA developers guidelines]&lt;br /&gt;
&lt;br /&gt;
== How to join the BGA developer team? ==&lt;br /&gt;
&lt;br /&gt;
Please see this page: [[How to join BGA developer team?]]&lt;br /&gt;
&lt;br /&gt;
== Great, I&#039;m in! ... How should I start? ==&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t already, check the presentations at the top of this page to get the basics.&lt;br /&gt;
&lt;br /&gt;
Then, you should checkout the [[First steps with BGA Studio]] to make sure that runs fine.&lt;br /&gt;
&lt;br /&gt;
After that, we advise you to take a peek at one or both of these two game creation tutorials:&lt;br /&gt;
* [[Tutorial reversi]]&lt;br /&gt;
* [[Tutorial gomoku]]&lt;br /&gt;
&lt;br /&gt;
Then start editing files and see what happens! ;)&lt;br /&gt;
&lt;br /&gt;
If you have any questions, please check out the &#039;&#039;&#039;[[Studio FAQ]]&#039;&#039;&#039; first, then if you didn&#039;t find the answer you were looking for, please post your question on the [http://forum.boardgamearena.com/viewforum.php?f=12 &#039;&#039;&#039;development forum&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
== BGA Studio documentation ==&lt;br /&gt;
&lt;br /&gt;
=== BGA Studio Framework reference ===&lt;br /&gt;
&lt;br /&gt;
This part of the documentation focus on the development framework itself: functions and methods available to build your game.&lt;br /&gt;
&lt;br /&gt;
[[Studio file reference|File structure of a BGA game]]&lt;br /&gt;
&lt;br /&gt;
==== Game logic ====&lt;br /&gt;
&lt;br /&gt;
* [[Main game logic: yourgamename.game.php]]&lt;br /&gt;
* [[Your game state machine: states.inc.php]]&lt;br /&gt;
* [[Game database model: dbmodel.sql]]&lt;br /&gt;
* [[Players actions: yourgamename.action.php]]&lt;br /&gt;
* [[Game material description: material.inc.php]]&lt;br /&gt;
* [[Game statistics: stats.inc.php]]&lt;br /&gt;
&lt;br /&gt;
==== Game interface ====&lt;br /&gt;
&lt;br /&gt;
* [[Game interface logic: yourgamename.js]]&lt;br /&gt;
* [[Game art: img directory]]&lt;br /&gt;
* [[Game interface stylesheet: yourgamename.css]]&lt;br /&gt;
* [[Game layout: view and template: yourgamename.view.php and yourgamename_yourgamename.tpl]]&lt;br /&gt;
&lt;br /&gt;
==== Other components ====&lt;br /&gt;
&lt;br /&gt;
* [[Translations]] (how to make your game translatable)&lt;br /&gt;
* [[Game options and preferences: gameoptions.inc.php]]&lt;br /&gt;
* [[Game replay]]&lt;br /&gt;
&lt;br /&gt;
=== BGA Studio game components reference ===&lt;br /&gt;
&lt;br /&gt;
Game components are useful tools you can use in your game adaptations.&lt;br /&gt;
&lt;br /&gt;
* [[Deck]]: a PHP component to manage cards (deck, hands, picking cards, moving cards, shuffle deck, ...).&lt;br /&gt;
* [[Counter]]: a JS component to manage a counter that can increase/decrease (ex: player&#039;s score).&lt;br /&gt;
* [[Draggable]]: a JS component to manage drag&#039;n&#039;drop actions.&lt;br /&gt;
* [[ExpandableSection]]: a JS component to manage a rectangular block of HTML than can be displayed/hidden.&lt;br /&gt;
* [[Scrollmap]]: a JS component to manage a scrollable game area (useful when the game area can be infinite. Examples:  Saboteur or Takenoko games).&lt;br /&gt;
* [[Stock]]: a JS component to manage and display a set of game elements displayed at a position.&lt;br /&gt;
* [[Wrapper]]: a JS component to wrap a  &amp;amp;lt;div&amp;amp;gt; element around his child, even if these elements are absolute positioned.&lt;br /&gt;
* [[Zone]]: a JS component to manage a zone of the board where several game elements can come and leave, but should be well displayed together (See for example: token&#039;s places at Can&#039;t Stop).&lt;br /&gt;
&lt;br /&gt;
== BGA Studio user guide ==&lt;br /&gt;
&lt;br /&gt;
This part of the documentation is a user guide for the BGA Studio online development environment.&lt;br /&gt;
&lt;br /&gt;
[[Tools and tips of BGA Studio]]&lt;br /&gt;
&lt;br /&gt;
[[Practical debugging]]&lt;br /&gt;
&lt;br /&gt;
[[Studio back-office]]&lt;br /&gt;
&lt;br /&gt;
[[Studio FAQ]]&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
&lt;br /&gt;
[http://forum.boardgamearena.com/viewforum.php?f=12 Development forum]&lt;br /&gt;
&lt;br /&gt;
[http://forum.boardgamearena.com/viewforum.php?f=4 Bugs forum]&lt;/div&gt;</summary>
		<author><name>Een</name></author>
	</entry>
</feed>