Exemplo n.º 1
0
 public void DistSortArray(SortState state, int[] items, SortItemState[] item_states)
 {
     dst_text.text += state.HasFlag(SortState.Compare) ? "●" : "○";
     dst_text.text += state.HasFlag(SortState.Exchange) ? "●" : "○";
     dst_text.text += state.HasFlag(SortState.Complete) ? "●" : "○";
     dst_text.text += state.HasFlag(SortState.Debug) ? "●" : "○";
     dst_text.text += "\t";
     for (int k = 0; k < items.Length; ++k)
     {
         if (item_states[k].HasFlag(SortItemState.Exchanged))
         {
             dst_text.text += "<color=#ff0000ff>" + (items[k].ToString("D3") + "</color>\t");
         }
         else if (item_states[k].HasFlag(SortItemState.Comparison))
         {
             dst_text.text += "<color=#0000ffff>" + (items[k].ToString("D3") + "</color>\t");
         }
         else if (item_states[k].HasFlag(SortItemState.SortEnd))
         {
             dst_text.text += "<color=#00ff00ff>" + (items[k].ToString("D3") + "</color>\t");
         }
         else if (item_states[k].HasFlag(SortItemState.DisableArea))
         {
             dst_text.text += "<color=#cccccc99>" + (items[k].ToString("D3") + "</color>\t");
         }
         else if (item_states[k].HasFlag(SortItemState.Pivot))
         {
             dst_text.text += "<color=#ff00ffff>" + (items[k].ToString("D3") + "</color>\t");
         }
         else
         {
             dst_text.text += (items[k].ToString("D3") + "\t");
         }
     }
     dst_text.text += "\n";
 }