コード例 #1
0
        private bool MoveIfValid(UnitCell unit, HexCoordinates coords)
        {
            if (unit.HasMoved)
            {
                return(false);
            }
            var path        = game.Cells.GetPathWithValidityCheck(unit, coords, player.ID);
            var isValidPath = path != null;

            if (isValidPath)
            {
                state = States.None;
                indicator.Clear();
                player.CmdMoveCell(
                    (Int16)player.ID, (Int16)unit.ID,
                    (Int16)coords.X, (Int16)coords.Z);
            }
            return(isValidPath);
        }