public void NewPositionNotExists_SerializedDeserialized_Success()
        {
            var target = ClientTurnDoneTransferMessage.Create();

            var parser = TransferMessageParserUtils.FindWriter(target);

            Assert.IsTrue(parser.IsWritable(target));
            var data = parser.Write(target);

            Console.WriteLine(data);
            var obj = (ClientTurnDoneTransferMessage)parser.Read(data);

            Assert.AreEqual(target.UnitActions.Count, obj.UnitActions.Count);
        }
Esempio n. 2
0
        public ClientTurnDoneTransferMessage GetNextTurn()
        {
            var me     = FindMe();
            var result = ClientTurnDoneTransferMessage.Create();

            for (var i = 0; i < me.Units.Count; i++)
            {
                var unit = me.Units[i];
                if (unit.Hp <= 0)
                {
                    continue;
                }

                Do(unit, me.Units, result);
            }

            return(result);
        }