[][src]Function sulis_state::script::script_cache::item_script

pub fn item_script<T>(
    parent: &Rc<RefCell<EntityState>>,
    kind: ScriptItemKind,
    targets: ScriptEntitySet,
    arg: Option<T>,
    func: &str
) -> Result<()> where
    T: for<'a> ToLua<'a> + Send

Runs a script on the given item, using the specified parent. If item_id is None, then it is assumed that the item exists on the parent at the specified item_index. If it Some, this is not assumed, but the specified index is still set on the item that is passed into the script state.