public void Write(SummonedEntity summonedEntity)
 {
     _writer.Write(summonedEntity.Id);
     _writer.Write(summonedEntity.DisplayName);
     _writer.Write(summonedEntity.EntityType);
     _writer.Write(summonedEntity.ClassName);
     _writer.Write(summonedEntity.PowerSetFullNames.Length);
     for (var i = 0; i < summonedEntity.PowerSetFullNames.Length; i++)
     {
         _writer.Write(summonedEntity.PowerSetFullNames[i]);
     }
     _writer.Write(summonedEntity.UpgradePowerFullNames.Length);
     for (var i = 0; i < summonedEntity.UpgradePowerFullNames.Length; i++)
     {
         _writer.Write(summonedEntity.UpgradePowerFullNames[i]);
     }
 }
예제 #2
0
        public SummonedEntity Read()
        {
            var summonedEntity = new SummonedEntity();

            summonedEntity.Id                = _reader.ReadString();
            summonedEntity.DisplayName       = _reader.ReadString();
            summonedEntity.EntityType        = _reader.ReadInt32();
            summonedEntity.ClassName         = _reader.ReadString();
            summonedEntity.PowerSetFullNames = new string[_reader.ReadInt32()];
            for (var i = 0; i < summonedEntity.PowerSetFullNames.Length; i++)
            {
                summonedEntity.PowerSetFullNames[i] = _reader.ReadString();
            }
            summonedEntity.UpgradePowerFullNames = new string[_reader.ReadInt32()];
            for (var i = 0; i < summonedEntity.UpgradePowerFullNames.Length; i++)
            {
                summonedEntity.UpgradePowerFullNames[i] = _reader.ReadString();
            }
            return(summonedEntity);
        }