/*
 * Copyright (c) 2016 acmi
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package acmi.l2.clientmod.unreal.core;

import acmi.l2.clientmod.io.annotation.UShort;

public class State extends Struct {
    public long probeMask;
    public long ignoreMask;
    @UShort
    public int labelTableOffset;
    public int stateFlags;

    public enum Flags {
        /**
         * Flags should be user-selectable in UnrealEd.
         */
        Editable(0x00000001),
        /**
         * Flags is automatic (the default state).
         */
        Auto(0x00000002),
        /**
         * Flags executes on client side.
         */
        Simulated(0x00000004);

        private int mask;

        Flags(int mask) {
            this.mask = mask;
        }

        @Override
        public String toString() {
            return "STATE_" + name();
        }
    }
}

@@ -1142,16 +1142,107 @@
 .core;%0A%0A
+import java.util.Arrays;%0Aimport java.util.Collection;%0Aimport java.util.stream.Collectors;%0A%0A
 import a
@@ -1872,16 +1872,494 @@
      %7D%0A%0A
+        public int getMask() %7B%0A            return mask;%0A        %7D%0A%0A        public static Collection%3CFlags%3E getFlags(int flags) %7B%0A            return Arrays.stream(values())%0A                    .filter(e -%3E (e.getMask() & flags) != 0)%0A                    .collect(Collectors.toList());%0A        %7D%0A%0A        public static int getFlags(Flags... flags) %7B%0A            int v = 0;%0A            for (Flags flag : flags)%0A                v %7C= flag.getMask();%0A            return v;%0A        %7D%0A%0A
         

Resolve #29