using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace AkiragestuProject { public partial class Form1 : Form { /// /// 参数影响类 /// akMood akm = new akMood(); /// /// 内容语言识别 /// akLanguage akl = new akLanguage(); /// /// 运算类 /// akOperation ako = new akOperation(); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { LoadAkira(); } #region 基本信息载入 /// /// 基本人格载入 /// public void LoadAkira() { try { AddMessage(1, "皓月人格模拟载入中……"); AddMessage(1, "版本 Ver.0.0.1"); AddMessage(1, "----------------"); AddMessage(1, "皓月基本参数读取..."); var ak = akm.GetMain(); AddMessage(1, "心情:" + ak.Mood); AddMessage(1, "精力:" + ak.Energy); AddMessage(1, "饥饿:" + ak.Hungry); AddMessage(1, "主要心理状态:" + ak.MentalityType); AddMessage(1, "皓月模拟人格数据载入完毕"); AddMessage(1, "----------------"); AddMessage(1, "输入 /help 可以获得基本帮助 (~ ̄▽ ̄~)"); } catch (Exception ex) { AddMessage(2, ex.ToString()); } } private void button1_Click(object sender, EventArgs e) { var Msg = textBox1.Text; textBox1.Text = null; if (Msg != null) { AddMessage(Msg); //识别内容 int Type = akl.GetlanguageType(Msg); if (Type == 2) { var Comstr = Msg.Substring(1); if(Comstr != null && Comstr != "") { AddMessage(1,akl.GetCommand(Comstr)); } } } } #endregion #region 显示控制 public void AddMessage(string str) { var msgtype = "> UserMsg : "; listBox1.Items.Add(DateTime.Now.ToLongTimeString().ToString() + msgtype + str); } public void AddMessage(int messagetype,string str) { var msgtype = ""; switch (messagetype) { case 1: msgtype = "> Msg : "; break; case 2: msgtype = "> Error :"; break; case 3: msgtype = "> Wran :"; break; } listBox1.Items.Add(DateTime.Now.ToLongTimeString().ToString() + msgtype + str); } #endregion } }