/// <summary> /// Retunrs a deep copy from this /// </summary> /// <returns>Deep copy BasePack</returns> public virtual BasePack DeepCopy() { BasePack returnedBasePack = new BasePack(); for (int i = 0; i < packSize; i++) { returnedBasePack[i] = this[i]; } return(returnedBasePack); }
/// <summary> /// Buld a TPack Pack /// </summary> /// <param name="pack">BasePack to be based</param> /// <returns>New TPack pack</returns> public abstract TPack PackFactory(BasePack pack);
/// <summary> /// Takes the <paramref name="basePack"/> inner buffer as its own inner beffer. /// The <see cref="readPosition"/> and the <see cref="writePosition"/> are not copied /// </summary> /// <param name="basePack">BasePack that will be copied</param> protected BasePack(BasePack basePack) { buffer = basePack.buffer; }
/// <summary> /// Send a pack /// </summary> /// <param name="pack">Pack to be sender</param> /// <param name="ip">Optional parameter used only by UDP protocol</param> public abstract void SendPack(BasePack pack, IPEndPoint ip = null);