Ejemplo n.º 1
0
        public static bool operator <(Cost c1, Cost c2)
        {
            if (c2 == null)
            {
                return(false);
            }
            if (c1 == null)
            {
                if (c2.CostType == CostTypes.Mana)
                {
                    if ((c2 as Mana).count == 0)
                    {
                        return(false);
                    }
                }
                return(true);
            }
            Cost      right    = c2.Clone();
            ManaTypes dominant = right.GetDominantMana();
            Cost      left     = c1.Clone();

            left.OrderFirst(dominant);
            right.OrderFirst(dominant);
            Cost result = right.Pay(ref left);

            return(result == null || result == CostTypes.Tap ? false : true);
        }
Ejemplo n.º 2
0
        public override void OrderFirst(ManaTypes mt)
        {
            List <Cost> manas  = new List <Cost> ();
            List <Cost> others = new List <Cost> ();

            foreach (Cost c in CostList)
            {
                if (c is Mana)
                {
                    manas.Add(c);
                }
                else
                {
                    others.Add(c);
                }
            }
            CostList = manas.OrderBy(m => (m as Mana).TypeOfMana).Concat(others).ToList();
        }
Ejemplo n.º 3
0
    public static void CreateMana(Nodes.Node n, ManaTypes type)
    {
        GameObject go = Instantiate(Defines.self.manaPrefab);

        go.transform.position         = n.pos;
        go.transform.localEulerAngles = new Vector3(0, 0, 0);

        Mana m = new Mana();

        m.go   = go;
        m.type = type;
        xa.uIds++;
        m.uId  = xa.uIds;
        n.mana = m;
        m.node = n;

        manas.Add(m);
    }
Ejemplo n.º 4
0
 // Restores the given amount of mana to the provided mana type
 public void RestoreMana(ManaTypes type, float amount)
 {
     if (type == ManaTypes.MANA_FORWARD)
     {
         manaForward += amount;
     }
     if (type == ManaTypes.MANA_BACKWARDS)
     {
         manaBackwards += amount;
     }
     if (type == ManaTypes.MANA_RIGHT)
     {
         manaRight += amount;
     }
     if (type == ManaTypes.MANA_LEFT)
     {
         manaLeft += amount;
     }
 }
Ejemplo n.º 5
0
 public Mana(int x)
     : base(CostTypes.Mana)
 {
     count      = x;
     TypeOfMana = ManaTypes.Colorless;
 }
Ejemplo n.º 6
0
 public Mana(int x, ManaTypes type)
     : base(CostTypes.Mana)
 {
     count      = x;
     TypeOfMana = type;
 }
Ejemplo n.º 7
0
 public Mana(ManaTypes type)
     : base(CostTypes.Mana)
 {
     TypeOfMana = type;
     count      = 1;
 }
Ejemplo n.º 8
0
 public Mana()
     : base(CostTypes.Mana)
 {
     TypeOfMana = ManaTypes.Colorless;
     count      = 0;
 }
Ejemplo n.º 9
0
 public virtual void OrderFirst(ManaTypes mt)
 {
 }