/*------------------------------------------------------------------------- * 분석 * 1데이터분 * フォーマット * 서버,해역명,상태,종료일時,補足 * 補足はあってもなくてもよい * ---------------------------------------------------------------------------*/ public bool Analize(string line) { try { string[] split = line.Split(new char[] { ',' }); if (split.Length < 4) { return(false); // 항목が少なすぎる } m_server = split[0]; m_name = split[1]; if (split[2].IndexOf("안전") >= 0) { m_sea_type = sea_area.sea_area_once.sea_type.safty; } else if (split[2].IndexOf("무법") >= 0) { m_sea_type = sea_area.sea_area_once.sea_type.lawless; } else { m_sea_type = sea_area.sea_area_once.sea_type.normal; } m_date = Useful.ToDateTime(split[3]); } catch { return(false); } return(true); }
/*------------------------------------------------------------------------- * * ---------------------------------------------------------------------------*/ public sea_area_once_from_dd() { m_name = ""; // 해역군명 m_server = ""; // 서버 m_date = new DateTime(); // 期限 m_sea_type = sea_area.sea_area_once.sea_type.normal; // 현황 }
/*------------------------------------------------------------------------- * 상태を설정する * ---------------------------------------------------------------------------*/ public bool SetType(string name, sea_area.sea_area_once.sea_type type) { sea_area.sea_area_once d = find(name); if (d == null) { return(false); } if (d.name == null) { return(false); } if ((int)type < 0) { type = sea_area_once.sea_type.normal; } if ((int)type > (int)sea_area_once.sea_type.lawless) { type = sea_area_once.sea_type.normal; } // 以前と違う場合지도の合成をリクエストする if (d.type != type) { d.type = type; m_lib.setting.req_update_map.Request(); } return(true); }
/*------------------------------------------------------------------------- * * ---------------------------------------------------------------------------*/ public sea_area_once_from_dd() { m_name = ""; // 海域群名 m_server = ""; // サーバ m_date = new DateTime(); // 期限 m_sea_type = sea_area.sea_area_once.sea_type.normal; // 状況 }
/*------------------------------------------------------------------------- * * ---------------------------------------------------------------------------*/ public sea_area_type(string name, sea_area.sea_area_once.sea_type type) { m_name = name; m_type = type; }