W
weischbier
Guest
So, I managed to get a list loaded into a datagridview.
Not to hard but challenging.
Now I want it to compare the numbers within this list with our currenttargets id which is uint.
here's my code:
Now, C# throws no errors with this and its loading everything fine.
But it returns false everytime.
For the record I only added this 31146 id to the file. It's the Raiders Dummy.
Any thoughts on this? I'm at the end with my coding skills...
greetz
Weischbier
Not to hard but challenging.
Now I want it to compare the numbers within this list with our currenttargets id which is uint.
here's my code:
Code:
//Import them
private void ImportIDs()
{
try
{
StreamReader s = new StreamReader(Path.Combine(Logging.ApplicationPath, string.Format(@"CustomClasses\Necrophilia - Advanced\Weischbier.Manager\Settings\BossIDs.ini")));
String str;
while ((str = s.ReadLine()) != null)
{
Logger.WriteDebug("Importing Bosses by Id: " + str);
List.BossIdList.Add(new BossIDs(Convert.ToUInt32(str)));
}
s.Close();
}
catch (Exception e)
{
Logger.Write(Color.Red, "Unable to read BossIDs.ini. Please read the Debug for more information.");
Logger.WriteDebug(e.Message);
}
}
public static System.ComponentModel.BindingList<BossIDs> BossIdList;
public class BossIDs
{
private uint blabla;
public BossIDs(uint listItem)
{
ListItem = listItem;
}
public uint ListItem
{
get { return blabla; }
set { blabla = value; }
}
}
//Compare them
public static bool IsBoss(this WoWUnit unit)
{
foreach (BossIDs b in List.BossIdList)
{
if (b != null && b.ListItem.Equals(StyxWoW.Me.CurrentTarget))
return true;
}
return false;
}
Now, C# throws no errors with this and its loading everything fine.
But it returns false everytime.
For the record I only added this 31146 id to the file. It's the Raiders Dummy.
Any thoughts on this? I'm at the end with my coding skills...
greetz
Weischbier