⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userplacevo.as

📁 Flex3实现的掼蛋游戏
💻 AS
字号:
/**
 * Project: 用户位置类 上、下、左、右 四个常量
 * Author : dmh2002 
 * Blog: dmh2002.com
 * QQ:122054933 MSN:shangxinyu2002@msn.com 
 * Date : 2008.04.10
 */
package com.dmh2002.games.cardgame.cairngorm.vo
{
	import com.adobe.cairngorm.vo.ValueObject;
	
	import flash.geom.Point;

	public class UserPlaceVO implements ValueObject
	{
		
		public static const USER_PLACE_LEFT:UserPlaceVO   = new UserPlaceVO("userPlaceLeft",
																			new Point(10,200))
		
		public static const USER_PLACE_RIGHT:UserPlaceVO  = new UserPlaceVO("userPlaceRight",
																			new Point(550,200))
		
		public static const USER_PLACE_TOP:UserPlaceVO    = new UserPlaceVO("userPlaceTop",
																			new Point(550,10))
	
		public static const USER_PLACE_BOTTOM:UserPlaceVO = new UserPlaceVO("userPlaceBottom",
																			new Point(10,500))
		
		
		public var name:String
		public var point:Point
		
		public function UserPlaceVO(_name:String,_point:Point):void
		{
			this.name  = _name;
			this.point = _point;
		}
		/** 根据用户数,返回用户位置数组
		 * 参数 num 用户数
		 * 返回用户位置数组
		 */ 
		public static function getUserPlaceArray(userNum:uint):Array
		{
			if(userNum>4) userNum =4
			
			var _array:Array = new Array(); 
			
			switch(userNum)
			{
				case 2:
					_array.push(USER_PLACE_TOP);
					_array.push(USER_PLACE_BOTTOM);
					break;
				case 3:
					_array.push(USER_PLACE_LEFT);
					_array.push(USER_PLACE_RIGHT);
					_array.push(USER_PLACE_BOTTOM);
					break;
				case 4:
					_array.push(USER_PLACE_LEFT);
					_array.push(USER_PLACE_TOP);
					_array.push(USER_PLACE_RIGHT);
					_array.push(USER_PLACE_BOTTOM);
					break;
				default:
					break;	
			}
			
			return _array
			
		}
	}
}
	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -