package com.elmakers.mine.bukkit.magic.dao;

import org.bukkit.Material;

import com.elmakers.mine.bukkit.persisted.PersistClass;
import com.elmakers.mine.bukkit.persisted.PersistField;
import com.elmakers.mine.bukkit.persistence.dao.MaterialData;

@PersistClass(schema="magic", name="cost", contained=true)
public class CastingCost
{
    public void addItem(Material material, int count)
    {
        this.item = new MaterialData(material);
        this.count = count;
    }
    
    @PersistField
    public float getHealth()
    {
        return health;
    }
    
    public void setHealth(float health)
    {
        this.health = health;
    }
    
    @PersistField
    public MaterialData getItem()
    {
        return item;
    }
    
    public void setItem(MaterialData item)
    {
        this.item = item;
    }
    
    @PersistField
    public int getCount()
    {
        return count;
    }
    
    public void setCount(int count)
    {
        this.count = count;
    }
    
    protected float        health = 0;
    protected MaterialData item   = null;
    protected int          count  = 0;
}

@@ -328,16 +328,180 @@
 gCost%0A%7B%0A
+    protected float        health = 0;%0A    protected float        mana   = 0;%0A    protected MaterialData item   = null;%0A    protected int          count  = 0;%0A    %0A
     publ
@@ -1161,122 +1161,156 @@
     
-protected float 
+@PersistField%0A    public float getMana()%0A
     
+%7B%0A
    
-health = 0;%0A    protected MaterialData item   = null;%0A    protected int
+     return mana;%0A    %7D%0A%0A    public void setMana(float mana)%0A
     
+%7B%0A
       
-count  = 0;
+  this.mana = mana;%0A    %7D%0A
 %0A%7D%0A

Add mana to casting cost.