extern crate rusty_c_sys;

use rusty_c_sys as ffi;

trait Pika2 {
    fn next_pika2(&mut self) -> i32;
}

impl Pika2 for i32 {

    fn next_pika2(&mut self) -> i32 {
        let raw = self as *mut i32;
        unsafe {
            ffi::next_pika2(raw)
        }
    }

}

#[cfg(test)]
mod tests {
    use super::*;
    
    #[test]
    fn from_escape() {
        let mut x = ffi::escape;
        let p = x.next_pika2();
        assert_eq!(x, ffi::attack);
        assert_eq!(p, ffi::attack);
    }

    #[test]
    fn from_attack() 


    #[test]
    fn from_defend() {
        let mut x = ffi::defend;
        let p = x.next_pika2();
        assert_eq!(x, ffi::attack);
        assert_eq!(p, ffi::attack);
    }
}


{
        let mut x = ffi::attack;
        let p = x.next_pika2();
        assert_eq!(x, ffi::defend);
        assert_eq!(p, ffi::defend);
    }