예제 #1
0
 public T[] getArray1D()
 {
     MyLib.MyArrayList <T> tempList = new MyLib.MyArrayList <T>(Size);
     DFS((x) => tempList.Add(x.Value));
     return(tempList.Array);
 }
예제 #2
0
 public DamagedByInfo(AttackAndDamage attackAndDamage) : this(attackAndDamage.Attack.Holder)
 {
     Attacks = new MyLib.MyArrayList <AttackAndDamage> {
         attackAndDamage
     };
 }
예제 #3
0
 public DamagedByInfo(Attack attack, float damage) : this(attack.Holder)
 {
     Attacks = new MyLib.MyArrayList <AttackAndDamage> {
         new AttackAndDamage(attack, damage)
     };
 }
예제 #4
0
 public DamagedByInfo(BaseCharacterControl character)
 {
     Character = character;
     Attacks   = new MyLib.MyArrayList <AttackAndDamage>();
 }
 public static Uinf TriangulateGauss(this bool[] bools, LinkedList <int> RowsRearrangement, MyLib.MyArrayList <Uinf> RowsTransposedAndGaussInfo)
 {
     return(new Uinf(bools, RowsRearrangement).TriangulateGauss(RowsTransposedAndGaussInfo));
 }
    public static LinkedList <Uinf> TriangulateGauss(this LinkedList <Uinf> Rows, LinkedList <int> RowsRearrangement, MyLib.MyArrayList <Uinf> RowsTransposedAndGaussInfo)
    {
        int ilen = Rows.Count;

        if (RowsRearrangement.Count < ilen)
        {
            return(Rows.RearrangeRowsFromTriangulation(RowsRearrangement, 0).TriangulateGauss(RowsRearrangement, RowsTransposedAndGaussInfo));
        }
        LinkedListNode <Uinf> NodeRow = Rows.First;

        RowsTransposedAndGaussInfo.Clear(Rows.First.Value.Length);
        int i = 0;

        for (Uinf shifted = new Uinf(1ul, ilen); i < RowsRearrangement.First.Value; NodeRow = NodeRow.Next, shifted <<= 1, i++)
        {
            if ((NodeRow.Value & shifted) == 0ul)
            {
                return(Rows.RearrangeRowsFromTriangulation(RowsRearrangement, i).TriangulateGauss(RowsRearrangement, RowsTransposedAndGaussInfo));
            }
            RowsTransposedAndGaussInfo.Add(new Uinf(ilen));
            //Debug.Log(NodeRow.Value);
            int j = 0;

            for (LinkedListNode <Uinf> NodeRow2 = Rows.First; j < i; NodeRow2 = NodeRow2.Next, j++)
            {
                if ((NodeRow2.Value & shifted) != 0ul)
                {
                    RowsTransposedAndGaussInfo.LastElement.SetBit(j);
                }
            }
            j++;
            for (LinkedListNode <Uinf> NodeRow2 = NodeRow.Next; NodeRow2 != null; NodeRow2 = NodeRow2.Next, j++)
            {
                if ((NodeRow2.Value & shifted) != 0ul)
                {
                    NodeRow2.Value ^= NodeRow.Value;
                    RowsTransposedAndGaussInfo.LastElement.SetBit(j);
                    //Debug.Log((i - 1).ToString() + " " + RowsTransposedAndGaussInfo.LastElement.ToString());
                }
            }
        }
        return(Rows);
    }