NScumm.Scumm.ScummEngine2.VerbOps C# (CSharp) Метод

VerbOps() приватный Метод

private VerbOps ( ) : void
Результат void
        void VerbOps()
        {
            int verb = ReadByte();
            int slot, state;

            switch (verb)
            {
                case 0:     // SO_DELETE_VERBS
                    slot = GetVarOrDirectByte(OpCodeParameter.Param1) + 1;
                    KillVerb(slot);
                    break;

                case 0xFF:  // Verb On/Off
                    verb = ReadByte();
                    state = ReadByte();
                    slot = GetVerbSlot(verb, 0);
                    Verbs[slot].CurMode = (byte)state;
                    break;

                default:
                    {  // New Verb
                        int x = ReadByte() * 8;
                        int y = ReadByte() * 8;
                        slot = GetVarOrDirectByte(OpCodeParameter.Param1) + 1;
                        int prep = ReadByte(); // Only used in V1?
                        // V1 Maniac verbs are relative to the 'verb area' - under the sentence
                        /*if (_game.platform == Common::kPlatformNES)
                                    x += 8;
                                else*/
                        if ((Game.GameId == GameId.Maniac) && (Game.Version == 1))
                            y += 8;

                        VerbSlot vs = Verbs[slot];
                        vs.VerbId = (ushort)verb;
                        /*if (_game.platform == Common::kPlatformNES) {
                                    vs.color = 1;
                                    vs.hicolor = 1;
                                    vs.dimcolor = 1;
                                } else*/
                        if (Game.Version == 1)
                        {
                            vs.Color = (byte)((Game.GameId == GameId.Maniac && (Game.Features.HasFlag(GameFeatures.Demo))) ? 16 : 5);
                            vs.HiColor = 7;
                            vs.DimColor = 11;
                        }
                        else
                        {
                            vs.Color = (byte)((Game.GameId == GameId.Maniac && (Game.Features.HasFlag(GameFeatures.Demo))) ? 13 : 2);
                            vs.HiColor = 14;
                            vs.DimColor = 8;
                        }
                        vs.Type = VerbType.Text;
                        vs.CharsetNr = String[0].Default.Charset;
                        vs.CurMode = 1;
                        vs.SaveId = 0;
                        vs.Key = 0;
                        vs.Center = false;
                        vs.ImgIndex = 0;
                        vs.Prep = (byte)prep;

                        vs.CurRect.Left = x;
                        vs.CurRect.Top = y;

                        // FIXME: these keyboard map depends on the language of the game.
                        // E.g. a german keyboard has 'z' and 'y' swapped, while a french
                        // keyboard starts with "azerty", etc.
                        /*if (Game.Platform == Platform.NES) {
                                    static const char keyboard[] = {
                                        'q','w','e','r',
                                        'a','s','d','f',
                                        'z','x','c','v'
                                    };
                                    if (1 <= slot && slot <= ARRAYSIZE(keyboard))
                                        vs.key = keyboard[slot - 1];
                                } else*/
                        {
                            char[] keyboard =
                                {
                                    'q', 'w', 'e', 'r', 't',
                                    'a', 's', 'd', 'f', 'g',
                                    'z', 'x', 'c', 'v', 'b'
                                };
                            if (1 <= slot && slot <= keyboard.Length)
                                vs.Key = (byte)keyboard[slot - 1];
                        }

                        // It follows the verb name
                        vs.Text = ReadCharacters();
                    }
                    break;
            }

            // Force redraw of the modified verb slot
            DrawVerb(slot, 0);
            VerbMouseOver(0);
        }
ScummEngine2