LazyBot/Assets/Scripts/Entity/EntityController.cs
/// <summary>
/// Updates ordered que of states based on its priority.
/// </summary>
Updates ordered que of states based on its priority.
Updates ordered que of states based on its priority .
protected void UpdateStates(LazyBot.Entity.Data.EntityState[] states, out Point[] order)
        {
            order = new Point[states.Length];
            for (int i = 0; i < states.Length; i++)
            {
                order[i].X = i;
                order[i].Y = states[i].Priority;
                states[i].Id = (uint)i;
                states[i].CheckOn.Remove((uint)i);
                states[i].CheckOn.ValidatesValues(0, (uint)(states.Length - 1));
                states[i].CheckOn.Bake();
            }
            order = order.OrderByDescending((state) => state.Y).ToArray();
        }
protected void UpdateStates ( LazyBot . Entity . Data . EntityState [ ] states , out Point [ ] order ) { order = new Point [ states . Length ] ; for ( int i = 0 ; i < states . Length ; i ++ ) { order [ i ] . X = i ; order [ i ] . Y = states [ i ] . Priority ; states [ i ] . Id = ( uint ) i ; states [ i ] . CheckOn . Remove ( ( uint ) i ) ; states [ i ] . CheckOn . ValidatesValues ( 0 , ( uint ) ( states . Length - 1 ) ) ; states [ i ] . CheckOn . Bake ( ) ; } order = order . OrderByDescending ( ( state ) => state . Y ) . ToArray ( ) ; }
Updates ordered que of states based on its priority.
Updates ordered que of states based on its priority .
states
LazyBot.Entity.Data.EntityState[]
Point[]
out