public S2C_UnitSetPARType(PacketReader reader, ChannelID channelID, NetID senderNetID)
        {
            this.SenderNetID = senderNetID;
            this.ChannelID   = channelID;

            this.PARType = reader.ReadPARType();

            this.ExtraBytes = reader.ReadLeft();
        }
示例#2
0
        public PrimaryAbilityResourceType TranslatePrimaryAbilityResourceType(PARType type)
        {
            switch (type)
            {
            case PARType.Mana:
                return(PrimaryAbilityResourceType.Mana);

            case PARType.Energy:
                return(PrimaryAbilityResourceType.Energy);

            case PARType.None:
                return(PrimaryAbilityResourceType.None);

            case PARType.Shield:
                return(PrimaryAbilityResourceType.Shield);

            case PARType.BattleFury:
                return(PrimaryAbilityResourceType.BattleFury);

            case PARType.DragonFury:
                return(PrimaryAbilityResourceType.DragonFury);

            case PARType.Rage:
                return(PrimaryAbilityResourceType.Rage);

            case PARType.Heat:
                return(PrimaryAbilityResourceType.Heat);

            case PARType.Ferocity:
                return(PrimaryAbilityResourceType.Ferocity);

            case PARType.BloodWell:
                return(PrimaryAbilityResourceType.BloodWell);

            case PARType.Gnarfury:
                return(PrimaryAbilityResourceType.GnarFury);

            case PARType.Wind:
                return(PrimaryAbilityResourceType.Wind);

            case PARType.Other:
                return(PrimaryAbilityResourceType.Other);

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
示例#3
0
 public static void WritePARType(this PacketWriter writer, PARType data)
 {
     writer.WriteByte((byte)data);
 }
示例#4
0
        static int Main(string[] args)
        {
            bool badArgs  = false;
            int  argCount = args.Length;
            int  argIndex = 0;

            Console.WriteLine("MPEG4 Modifier CL v1.4.4a");
            Console.WriteLine("http://www.moitah.net/");
            Console.WriteLine();

            try {
                while (argIndex < argCount)
                {
                    switch (args[argIndex])
                    {
                    case "--always-write":
                        _alwaysWrite = true;
                        break;

                    case "--unpack":
                        _unpack = true;
                        break;

                    case "--pack":
                        _pack = true;
                        break;

                    case "--par":
                        _changePAR = true;
                        switch (args[++argIndex])
                        {
                        case "square":
                            _parType = PARType.VGA_1_1;
                            break;

                        case "43pal":
                            _parType = PARType.PAL_4_3;
                            break;

                        case "43ntsc":
                            _parType = PARType.NTSC_4_3;
                            break;

                        case "169pal":
                            _parType = PARType.PAL_16_9;
                            break;

                        case "169ntsc":
                            _parType = PARType.NTSC_16_9;
                            break;

                        case "custom":
                            string[] customPARStr = args[++argIndex].Split(':');
                            if (customPARStr.Length != 2)
                            {
                                throw new Exception();
                            }
                            _parType   = PARType.Custom;
                            _customPAR = Double.Parse(customPARStr[0]) / Double.Parse(customPARStr[1]);
                            break;

                        default:
                            throw new Exception();
                        }
                        break;

                    case "--dar":
                        _changeDAR = true;
                        switch (args[++argIndex])
                        {
                        case "custom":
                            string[] customDARStr = args[++argIndex].Split(':');
                            if (customDARStr.Length != 2)
                            {
                                throw new Exception();
                            }
                            _customDAR = Double.Parse(customDARStr[0]) / Double.Parse(customDARStr[1]);
                            break;

                        default:
                            throw new Exception();
                        }
                        break;

                    case "--field-order":
                        _changeFieldOrder = true;
                        switch (args[++argIndex])
                        {
                        case "tff":
                            _isTFF = true;
                            break;

                        case "bff":
                            _isTFF = false;
                            break;

                        default:
                            throw new Exception();
                        }
                        break;

                    case "--info":
                        _showInfo = true;
                        break;

                    case "--frame-list":
                        _writeFrameList = true;
                        _frameListPath  = args[++argIndex];
                        break;

                    default:
                        goto BreakArgLoop;
                    }

                    argIndex++;
                }
            }
            catch {
                badArgs = true;
            }
BreakArgLoop:

            if ((argIndex >= (argCount - 2)) && (argIndex < argCount))
            {
                _pathSrc = args[argIndex++];
                if (argIndex < argCount)
                {
                    _pathDst = args[argIndex++];
                }
                else
                {
                    if (_unpack || _pack || _changePAR)
                    {
                        badArgs = true;
                    }
                    if (!_showInfo && !_writeFrameList)
                    {
                        badArgs = true;
                    }
                }
            }
            else
            {
                badArgs = true;
            }

            if ((_pack && _unpack) || (_changePAR && _changeDAR))
            {
                badArgs = true;
            }

            if (badArgs)
            {
                Console.WriteLine("Arguments: [switches] source_path [dest_path]");
                Console.WriteLine("  dest_path is only optional with --info or --frame-list");
                Console.WriteLine();
                Console.WriteLine("Switches:");
                Console.WriteLine("  --unpack             Remove packed bitstream.");
                Console.WriteLine("  --pack               Add packed bitstream.");
                Console.WriteLine("  --par <val>          Set the pixel aspect ratio, <val> is:");
                Console.WriteLine("                         square - Square Pixel Shape");
                Console.WriteLine("                         43pal - 4:3 PAL Pixel Shape");
                Console.WriteLine("                         43ntsc - 4:3 NTSC Pixel Shape");
                Console.WriteLine("                         169pal - 16:9 PAL Pixel Shape");
                Console.WriteLine("                         169ntsc - 16:9 NTSC Pixel Shape");
                Console.WriteLine("                         custom <width:height> - Custom Pixel Shape");
                Console.WriteLine("  --dar <val>          Set the display aspect ratio, <val> is:");
                Console.WriteLine("                         custom <width:height> - Custom Display Shape");
                Console.WriteLine("  --field-order <val>  Change the interlaced field order, <val> is:");
                Console.WriteLine("                         tff - Top Field First");
                Console.WriteLine("                         bff - Bottom Field First");
                Console.WriteLine("  --info               Display detailed information about the video.");
                Console.WriteLine("  --frame-list <path>  Write a text file containing each frame's type,");
                Console.WriteLine("                       timestamp, and size to the location specified.");
                Console.WriteLine("  --always-write       Write a new file even if the video format isn't being");
                Console.WriteLine("                       changed (useful for converting OpenDML AVIs < 2GB to ");
                Console.WriteLine("                       standard AVIs).");
                return(1);
            }

            try {
                return(Run());
            }
            catch (Exception ex) {
                Console.WriteLine("Error: " + ex.Message);
                return(1);
            }
        }