Exemplo n.º 1
0
 /// <summary>
 /// 上阵
 /// </summary>
 /// <param name="teammemberId"></param>
 /// <param name="playerId"></param>
 /// <param name="itemProperty"></param>
 public void UpFormation(Guid teammemberId, int playerId, PlayerCardProperty itemProperty)
 {
     if (!this.TeammebmerDic.ContainsKey(teammemberId))
     {
         this.TeammebmerDic.Add(teammemberId,
                                new ArenaTeammember()
         {
             ItemId = teammemberId, PlayerId = playerId, UsePlayer = itemProperty
         });
     }
 }
Exemplo n.º 2
0
 void WritePlayerCardProperty(BinaryWriter writer, PlayerCardProperty property)
 {
     ByteWriter.WriteTo(writer, property != null);
     if (property == null)
     {
         return;
     }
     ByteWriter.WriteTo(writer, property.Exp);
     ByteWriter.WriteTo(writer, property.IsMain);
     ByteWriter.WriteTo(writer, property.IsTrain);
     ByteWriter.WriteTo(writer, property.Level);
     ByteWriter.WriteTo(writer, property.Strength);
     ByteWriter.WriteTo(writer, property.TeammemberId);
     ByteWriter.WriteTo(writer, property.TheActualKpi);
     WriteEquipmentUsed(writer, property.Equipment);
 }
Exemplo n.º 3
0
        PlayerCardProperty ReadPlayerCardProperty(byte[] buffer, ref int offset)
        {
            PlayerCardProperty property = null;
            var flag = ByteReader.ReadBoolean(buffer, ref offset);

            if (flag)
            {
                property              = new PlayerCardProperty();
                property.Exp          = ByteReader.ReadInt32(buffer, ref offset);
                property.IsMain       = ByteReader.ReadBoolean(buffer, ref offset);
                property.IsTrain      = ByteReader.ReadBoolean(buffer, ref offset);
                property.Level        = ByteReader.ReadInt32(buffer, ref offset);
                property.Strength     = ByteReader.ReadInt32(buffer, ref offset);
                property.TeammemberId = new Guid(ByteReader.ReadString(buffer, ref offset));
                property.TheActualKpi = ByteReader.ReadInt32(buffer, ref offset);
                property.Equipment    = ReadEquipmentUsed(buffer, ref offset);
            }
            return(property);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 替换阵型
 /// </summary>
 /// <param name="teammemberId"></param>
 /// <param name="byTeammemberId"></param>
 /// <param name="playerId"></param>
 /// <param name="itemProperty"></param>
 public void ExchangePlayer(Guid teammemberId, Guid byTeammemberId, int playerId, PlayerCardProperty itemProperty)
 {
     if (this.TeammebmerDic.ContainsKey(byTeammemberId))
     {
         this.TeammebmerDic.Remove(byTeammemberId);
     }
     if (!this.TeammebmerDic.ContainsKey(teammemberId))
     {
         this.TeammebmerDic.Add(teammemberId,
                                new ArenaTeammember()
         {
             ItemId = teammemberId, PlayerId = playerId, UsePlayer = itemProperty
         });
     }
 }