Package cn.com.hotmaze.entity

Source Code of cn.com.hotmaze.entity.Role

package cn.com.hotmaze.entity;

import cn.com.hotmaze.util.Cell;
import cn.com.hotmaze.util.RoomMap;
import cn.com.hotmaze.util.Vec2;

public class Role extends MoveEntity{

  private int roleId;
 
  //TODO �ṹҪ����
  private RoomMap map;
 
  public Role(int roleId) {
    // TODO Auto-generated constructor stub
  }

  /* (non-Javadoc)
   * @see cn.com.hotmaze.entity.MoveEntity#canMoveToTarget(cn.com.hotmaze.util.Vec2)
   * check this player can move to this target
   */
  @Override
  public boolean canMoveToTarget(Vec2 target) {
    // TODO Auto-generated method stub
    Cell cell = map.getCellInfoByVec(target);
    if(cell.getTerrain() == 0){
      return true;
    }else if(cell.getTerrain() == 1){
      return false;
    }
   
    return false;
  }

  public void setRoleId(int roleId) {
    this.roleId = roleId;
  }

  public int getRoleId() {
    return roleId;
  }

}
TOP

Related Classes of cn.com.hotmaze.entity.Role

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.