Example #1
0
        public ServerYouConnectedTransferMessage AddUnit(
            int unitId,
            UnitUtils.UnitType unitType,
            int visionRange,
            int moveRange,
            int attackDamage,
            int attackDistance,
            bool attackFriendlyFire,
            int attackRadius,
            int hp,
            int maxHp)
        {
            var unit = UnitSubMessage.Create();

            unit.UnitId             = unitId;
            unit.UnitType           = unitType;
            unit.VisionRange        = visionRange;
            unit.MoveRange          = moveRange;
            unit.AttackDamage       = attackDamage;
            unit.AttackDistance     = attackDistance;
            unit.AttackFriendlyFire = attackFriendlyFire;
            unit.AttackRadius       = attackRadius;
            unit.Hp    = hp;
            unit.MaxHp = maxHp;
            this.UnitsData.Add(unit);
            return(this);
        }
Example #2
0
        public ClientConnectTransferMessage AddUnitType(UnitUtils.UnitType value)
        {
            var unit = UnitSubMessage.Create();

            unit.UnitType = value;
            this.UnitsData.Add(unit);
            return(this);
        }
Example #3
0
        public ServerClientConnectedTransferMessage AddUnit(int unitId, UnitUtils.UnitType unitType)
        {
            var unitData = UnitSubMessage.Create();

            unitData.UnitId   = unitId;
            unitData.UnitType = unitType;
            this.Units.Add(unitData);
            return(this);
        }
Example #4
0
        public ServerCurrentStateTransferMessage AddUnit(int playerIndex, int unitId, int posX, int posY, int hp)
        {
            var unit = UnitSubMessage.Create();

            unit.Hp         = hp;
            unit.UnitId     = unitId;
            unit.Position   = PointSubMessage.Create();
            unit.Position.X = posX;
            unit.Position.Y = posY;
            this.Players[playerIndex].Units.Add(unit);
            return(this);
        }