1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| using System;
using System.Collections.Generic;
using System.Text;
namespace Recutex
{
static public class ListAddr
{
public struct S_Addr
{
public int AddrId;
public int X; // X ecran
public int Y; // Y ecran
public int WGSX;
public int WGSY;
public int order;
public int ordern;
public bool active;
};
static public List<S_Addr> AddrLst = new List<S_Addr>();
public class S_AddrIdComparer : IComparer<S_Addr>
{
public int Compare(S_Addr a, S_Addr b)
{
return a.AddrId - b.AddrId;
}
};
public class S_AddrActiveOrderComparer : IComparer<S_Addr>
{
public int Compare(S_Addr a, S_Addr b)
{
int dif;
if (a.active == b.active)
{
if (a.active == false)
{
return 999;
}
dif = (a.order - b.order);
return dif;
}
if (a.active == true) return -1;
return 0;
}
};
// S_AddrIdComparer compareId = new S_AddrIdComparer();
// S_AddrActiveOrderComparer compareActiveOrder = new S_AddrActiveOrderComparer();
}
} |
Partager