Exemplo n.º 1
0
        public string Format()
        {
            string res = From.ToString() + ":\n";

            foreach (string s in Text.Split('\n'))
            {
                res += " - " + s + "\n";
            }
            return(res.Substring(0, res.Length - 1));          // To remove last \n symbol
        }
Exemplo n.º 2
0
 public bool CreatePlayer(int userid, string name, EPlayerJob playerJob, ECharacter character)
 {
     try
     {
         MySqlCommand cmd = new MySqlCommand("insert into player(userid,name,playerjob,playercharacter) values(@userid,@name,@playerjob,@character)", sqlConn);
         cmd.Parameters.AddWithValue("@userid", userid);
         cmd.Parameters.AddWithValue("@name", name);
         cmd.Parameters.AddWithValue("@playerjob", playerJob.ToString());
         cmd.Parameters.AddWithValue("@character", character.ToString());
         cmd.ExecuteNonQuery();
         return(true);
     }
     catch (Exception e)
     {
         Console.WriteLine("在创建角色的时候出现异常:" + e);
         return(false);
     }
 }
Exemplo n.º 3
0
 public void AddKill(ECharacter _eCharacter)
 {
     MyCharacterKillRecords[_eCharacter]++;
     Debug.Log(_eCharacter.ToString() + " kill times: " + MyCharacterKillRecords[_eCharacter].ToString());
 }
Exemplo n.º 4
0
    public virtual void Assist()
    {
        CharacterAssistEventArgs curAssistArgs = new CharacterAssistEventArgs("Assistance is the symbol of a good teammate.", m_ECharacter.ToString(), 1);

        CharacterAssistHandler?.Invoke(this, curAssistArgs);
    }