package com.xt.hb.utils
{
	/**
	 * Ais共通处理
	 * 共用代码转换等功能
	 */
	public class AisUtils
	{
		public function AisUtils()
		{
		}
		/**
		 * 根据船舶和货物类型编码返回名称
		 */
		public static function getCbhwlxByCode(code:String):String{
			switch(code)
			{
				case "3":
				{
					return "作业船";
					break;
				}
				case "4":
				{
					return "高速轮";
					break;
				}
				case "5":
				{
					return "拖轮";
					break;
				}
				case "6":
				{
					return "客轮";
					break;
				}
				case "7":
				{
					return "货轮";
					break;
				}
				case "8":
				{
					return "油轮";
					break;
				}
				default:
				{
					return "其他";
					break;
				}
			}
		}
		/**
		 * 根据船舶类型获取船舶颜色值
		 */
		public static function getColorByShipType(shiptype:String):Number{
			switch(shiptype)
			{
				case "3":
				{
					return 0xc0c0c0;
					break;
				}
				case "4":
				{
					return 0xf5e500;
					break;
				}
				case "5":
				{
					return 0x00fffe;
					break;
				}
				case "6":
				{
					return 0x0004ff;
					break;
				}
				case "7":
				{
					return 0x00ff00;
					break;
				}
				case "8":
				{
					return 0xfc010a;
					break;
				}
				default:
				{
					return 0xff00f7;
					break;
				}
			}
		}
		/**
		 * 根据船舶类型获取船舶颜色值
		 */
		public static function getColorByDanger(danger:String):Number{
			switch(danger)
			{
				case "0":
				{
					return 0x00ff00;
					break;
				}
				case "1":
				{
					return 0xFC010A;
					break;
				}
				default:
				{
					return 0x00ff00;
					break;
				}
			}
		}
	}
}