Android Open Source - GhostStories E Tile Location






From Project

Back to project page GhostStories.

License

The source code is released under:

GNU General Public License

If you think the Android project GhostStories listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package games.ghoststories.enums;
//from w  ww.j  a  v  a 2 s. co m
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.Map;

import games.ghoststories.R;

/**
 * Defines the different village tile locations
 */
public enum ETileLocation {
   TOP_LEFT(R.id.village_tile_1),
   TOP_CENTER(R.id.village_tile_2),
   TOP_RIGHT(R.id.village_tile_3),
   MIDDLE_LEFT(R.id.village_tile_4),
   MIDDLE_CENTER(R.id.village_tile_5),
   MIDDLE_RIGHT(R.id.village_tile_6),
   BOTTOM_LEFT(R.id.village_tile_7),
   BOTTOM_CENTER(R.id.village_tile_8),
   BOTTOM_RIGHT(R.id.village_tile_9);
   
   /**
    * Constructor
    * @param pLayoutId The view id for the tile
    */
   private ETileLocation(final int pLayoutId) {
      mLayoutId = pLayoutId;
   }
   
   /**
    * @return The view id for the tile
    */
   public int getLayoutId() {
      return mLayoutId;
   }
   
   /**
    * @return The set of tiles that are adjacent to this tile
    */
   public EnumSet<ETileLocation> getAdjacentTiles() {
      return sAdjacentTileMap.get(this);
   }
   
   /** The view id for the tile **/
   private final int mLayoutId;
   
   /** The map containing the adjacent tile information **/
   private static Map<ETileLocation, EnumSet<ETileLocation> > sAdjacentTileMap = 
         new EnumMap<ETileLocation, EnumSet<ETileLocation> >(ETileLocation.class);
   static {
      sAdjacentTileMap.put(TOP_LEFT, 
            EnumSet.of(TOP_CENTER, MIDDLE_LEFT, MIDDLE_CENTER));
      sAdjacentTileMap.put(TOP_CENTER, 
            EnumSet.of(TOP_LEFT, TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT));
      sAdjacentTileMap.put(TOP_RIGHT, 
            EnumSet.of(TOP_CENTER, MIDDLE_CENTER, MIDDLE_RIGHT));
      sAdjacentTileMap.put(MIDDLE_LEFT, 
            EnumSet.of(TOP_LEFT, TOP_CENTER, MIDDLE_CENTER, BOTTOM_LEFT, BOTTOM_CENTER));
      sAdjacentTileMap.put(MIDDLE_CENTER, 
            EnumSet.complementOf(EnumSet.of(MIDDLE_CENTER)));
      sAdjacentTileMap.put(MIDDLE_RIGHT, 
            EnumSet.of(TOP_CENTER, TOP_RIGHT, MIDDLE_CENTER, BOTTOM_CENTER, BOTTOM_RIGHT));
      sAdjacentTileMap.put(BOTTOM_LEFT, 
            EnumSet.of(MIDDLE_LEFT, MIDDLE_CENTER, BOTTOM_CENTER));
      sAdjacentTileMap.put(BOTTOM_CENTER, 
            EnumSet.of(MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT));
      sAdjacentTileMap.put(BOTTOM_RIGHT,
            EnumSet.of(MIDDLE_CENTER, MIDDLE_RIGHT, BOTTOM_CENTER));
   }
}




Java Source Code List

com.drawable.shapes.GradientRectangle.java
com.interfaces.IDraggable.java
com.utils.AndroidUtils.java
com.utils.AnimationUtils2.java
com.utils.ImageLoadingTask.java
com.utils.ImageRotationTask.java
com.utils.ImageViewUtils.java
com.views.NumberedImageView.java
com.views.ToggledImageView.java
com.views.layouts.ScaledLinearLayout.java
com.views.layouts.ScaledRelativeLayout.java
com.views.layouts.SquareGridLayout.java
com.views.layouts.SquareLinearLayout.java
com.views.layouts.SquareTableLayout.java
com.views.layouts.ZoomableRelativeLayout.java
com.views.listeners.DragTouchListener.java
games.ghoststories.activities.GameLoadingActivity.java
games.ghoststories.activities.GameScreenActivity.java
games.ghoststories.activities.TitleActivity.java
games.ghoststories.controllers.GhostDeckController.java
games.ghoststories.controllers.HaunterController.java
games.ghoststories.controllers.PlayerBoardCardController.java
games.ghoststories.controllers.VillageTileController.java
games.ghoststories.controllers.combat.CombatAreaController.java
games.ghoststories.controllers.combat.DiceDragListener.java
games.ghoststories.controllers.combat.GhostDragListener.java
games.ghoststories.controllers.combat.TaoTokenDragListener.java
games.ghoststories.data.DragData.java
games.ghoststories.data.GameBoardData.java
games.ghoststories.data.GhostData.java
games.ghoststories.data.GhostDeckData.java
games.ghoststories.data.GhostGraveyardData.java
games.ghoststories.data.GhostStoriesBitmaps.java
games.ghoststories.data.GhostStoriesConstants.java
games.ghoststories.data.GhostStoriesGameManager.java
games.ghoststories.data.PlayerData.java
games.ghoststories.data.TokenSupplyData.java
games.ghoststories.data.interfaces.IGameBoardListener.java
games.ghoststories.data.interfaces.IGamePhaseListener.java
games.ghoststories.data.interfaces.IGameTokenListener.java
games.ghoststories.data.interfaces.IGhostDeckListener.java
games.ghoststories.data.interfaces.IGhostListener.java
games.ghoststories.data.interfaces.ITokenListener.java
games.ghoststories.data.interfaces.IVillageTileListener.java
games.ghoststories.data.village.BuddhistTempleTileData.java
games.ghoststories.data.village.CircleOfPrayerTileData.java
games.ghoststories.data.village.VillageTileDataFactory.java
games.ghoststories.data.village.VillageTileData.java
games.ghoststories.enums.EBoardLocation.java
games.ghoststories.enums.ECardLocation.java
games.ghoststories.enums.EColor.java
games.ghoststories.enums.ECombatPhase.java
games.ghoststories.enums.EDiceSide.java
games.ghoststories.enums.EDice.java
games.ghoststories.enums.EDifficulty.java
games.ghoststories.enums.EDragItem.java
games.ghoststories.enums.EGamePhase.java
games.ghoststories.enums.EGhostAbility.java
games.ghoststories.enums.EHaunterLocation.java
games.ghoststories.enums.EPlayerAbility.java
games.ghoststories.enums.ETileLocation.java
games.ghoststories.enums.EVillageTile.java
games.ghoststories.fragments.AuxAreaFragment.java
games.ghoststories.fragments.GameboardFragment.java
games.ghoststories.utils.BitmapUtils.java
games.ghoststories.utils.GameUtils.java
games.ghoststories.utils.XmlUtils.java
games.ghoststories.views.GameScreen.java
games.ghoststories.views.aux_area.CardInfoView.java
games.ghoststories.views.aux_area.GamePhaseDetailsView.java
games.ghoststories.views.aux_area.GamePhaseView.java
games.ghoststories.views.aux_area.GhostDeckView.java
games.ghoststories.views.aux_area.GhostGraveyardCardView.java
games.ghoststories.views.aux_area.PlayerInfoView.java
games.ghoststories.views.combat.CombatDamageView.java
games.ghoststories.views.combat.CombatDiceAreaView.java
games.ghoststories.views.combat.CombatDiceView.java
games.ghoststories.views.combat.CombatGhostView.java
games.ghoststories.views.combat.CombatInstructionsView.java
games.ghoststories.views.combat.CombatRollView.java
games.ghoststories.views.combat.CombatView.java
games.ghoststories.views.combat.ExtraCombatDiceView.java
games.ghoststories.views.combat.GhostHealthView.java
games.ghoststories.views.common.AbstractNumberedTokenView.java
games.ghoststories.views.common.BuddhaTokenView.java
games.ghoststories.views.common.QiTokenView.java
games.ghoststories.views.common.TaoTokenView.java
games.ghoststories.views.common.YinYangTokenView.java
games.ghoststories.views.gameboard.PlayerAreaView.java
games.ghoststories.views.gameboard.PlayerBoardCardView.java
games.ghoststories.views.gameboard.PlayerBoardView.java
games.ghoststories.views.gameboard.PlayerTokenAreaView.java
games.ghoststories.views.gameboard.VillageTileView.java
games.ghoststories.views.graveyard.GraveyardScrollView.java
games.ghoststories.views.graveyard.GraveyardView.java
games.ghoststories.views.title.TitleButton.java
games.ghoststories.views.title.TitleScreen.java
games.ghoststories.views.village.CircleOfPrayerView.java