/* LCM type definition class file
 * This file was automatically generated by lcm-gen
 * DO NOT MODIFY BY HAND!!!!
 */

package forseti2;
 
import java.io.*;
import java.util.*;
import lcm.lcm.*;
 
public final class piemos_health implements lcm.lcm.LCMEncodable
{
    public forseti2.header header;
    public boolean auton;
    public boolean enabled;
    public boolean robot_connection;
    public boolean xbox_controller;
    public int game_time;
 
    public piemos_health()
    {
    }
 
    public static final long LCM_FINGERPRINT;
    public static final long LCM_FINGERPRINT_BASE = 0x684c6c42b9e14cf1L;
 
    static {
        LCM_FINGERPRINT = _hashRecursive(new ArrayList<Class<?>>());
    }
 
    public static long _hashRecursive(ArrayList<Class<?>> classes)
    {
        if (classes.contains(forseti2.piemos_health.class))
            return 0L;
 
        classes.add(forseti2.piemos_health.class);
        long hash = LCM_FINGERPRINT_BASE
             + forseti2.header._hashRecursive(classes)
            ;
        classes.remove(classes.size() - 1);
        return (hash<<1) + ((hash>>63)&1);
    }
 
    public void encode(DataOutput outs) throws IOException
    {
        outs.writeLong(LCM_FINGERPRINT);
        _encodeRecursive(outs);
    }
 
    public void _encodeRecursive(DataOutput outs) throws IOException
    {
        this.header._encodeRecursive(outs); 
 
        outs.writeByte( this.auton ? 1 : 0); 
 
        outs.writeByte( this.enabled ? 1 : 0); 
 
        outs.writeByte( this.robot_connection ? 1 : 0); 
 
        outs.writeByte( this.xbox_controller ? 1 : 0); 
 
        outs.writeInt(this.game_time); 
 
    }
 
    public piemos_health(byte[] data) throws IOException
    {
        this(new LCMDataInputStream(data));
    }
 
    public piemos_health(DataInput ins) throws IOException
    {
        if (ins.readLong() != LCM_FINGERPRINT)
            throw new IOException("LCM Decode error: bad fingerprint");
 
        _decodeRecursive(ins);
    }
 
    public static forseti2.piemos_health _decodeRecursiveFactory(DataInput ins) throws IOException
    {
        forseti2.piemos_health o = new forseti2.piemos_health();
        o._decodeRecursive(ins);
        return o;
    }
 
    public void _decodeRecursive(DataInput ins) throws IOException
    {
        this.header = forseti2.header._decodeRecursiveFactory(ins);
 
        this.auton = ins.readByte()!=0;
 
        this.enabled = ins.readByte()!=0;
 
        this.robot_connection = ins.readByte()!=0;
 
        this.xbox_controller = ins.readByte()!=0;
 
        this.game_time = ins.readInt();
 
    }
 
    public forseti2.piemos_health copy()
    {
        forseti2.piemos_health outobj = new forseti2.piemos_health();
        outobj.header = this.header.copy();
 
        outobj.auton = this.auton;
 
        outobj.enabled = this.enabled;
 
        outobj.robot_connection = this.robot_connection;
 
        outobj.xbox_controller = this.xbox_controller;
 
        outobj.game_time = this.game_time;
 
        return outobj;
    }
 
}

