// [DataMember] //public PanoramaPage1 Page //{ // get { return page; } // set { page = value; } //} //[DataMember] //public List<Image> CrossbowmanImageList //{ // get { return crossbowmanImageList; } // set { crossbowmanImageList = value; } //} //[DataMember] //public List<Image> WebberImageList //{ // get { return webberImageList; } // set { webberImageList = value; } //} //[DataMember] //public List<Image> LeaderImageList //{ // get { return leaderImageList; } // set { leaderImageList = value; } //} ////public int b=1; public Dwarf(DwarfType t, Point p) { type = t; Position = p; IsSelected = false; //foreach (Image img in page.DwarfsGrid.Children) //{ // if (img.Name == "crossbowmanCounter1") // { // crossbowmanImageList.Add(img); // } // else // if (img.Name == "crossbowmanCounter2") // { // crossbowmanImageList.Add(img); // } // else // if (img.Name == "crossbowmanCounter3") // { // crossbowmanImageList.Add(img); // } // else // if (img.Name == "crossbowmanCounter4") // { // crossbowmanImageList.Add(img); // } // else // if (img.Name == "crossbowmanCounter5") // { // crossbowmanImageList.Add(img); // } // else // if (img.Name == "webberCounter1") // { // webberImageList.Add(img); // } // else // if (img.Name == "webberCounter2") // { // webberImageList.Add(img); // } // else // if (img.Name == "webberCounter3") // { // webberImageList.Add(img); // } // else // if (img.Name == "webberCounter4") // { // webberImageList.Add(img); // } // else // if (img.Name == "leaderCounter1") // { // leaderImageList.Add(img); // } // else // if (img.Name == "leaderCounter2") // { // leaderImageList.Add(img); // } // else // if (img.Name == "leaderCounter3") // { // leaderImageList.Add(img); // } // else // if (img.Name == "leaderCounter4") // { // leaderImageList.Add(img); // } // else // if (img.Name == "leaderCounter5") // { // leaderImageList.Add(img); // } // else // if (img.Name == "leaderCounter6") // { // leaderImageList.Add(img); // } //} switch (type) { case (DwarfType.Crossbowman): hp = 5; originalHp = 5; //dwarfImageList = crossbowmanImageList; break; case (DwarfType.Leader): hp = 6; originalHp = 6; // dwarfImageList = leaderImageList; break; case (DwarfType.Webber): hp = 4; originalHp = 4; //dwarfImageList = webberImageList; break; default: break; } }
//public int b=1; public Dwarf(DwarfType t, Point p, PanoramaPage1 pag) { type = t; page = pag; Position = p; IsSelected = false; foreach (Image img in page.DwarfsGrid.Children) { if (img.Name == "crossbowmanCounter1") { crossbowmanImageList.Add(img); } else if (img.Name == "crossbowmanCounter2") { crossbowmanImageList.Add(img); } else if (img.Name == "crossbowmanCounter3") { crossbowmanImageList.Add(img); } else if (img.Name == "crossbowmanCounter4") { crossbowmanImageList.Add(img); } else if (img.Name == "crossbowmanCounter5") { crossbowmanImageList.Add(img); } else if (img.Name == "webberCounter1") { webberImageList.Add(img); } else if (img.Name == "webberCounter2") { webberImageList.Add(img); } else if (img.Name == "webberCounter3") { webberImageList.Add(img); } else if (img.Name == "webberCounter4") { webberImageList.Add(img); } else if (img.Name == "leaderCounter1") { leaderImageList.Add(img); } else if (img.Name == "leaderCounter2") { leaderImageList.Add(img); } else if (img.Name == "leaderCounter3") { leaderImageList.Add(img); } else if (img.Name == "leaderCounter4") { leaderImageList.Add(img); } else if (img.Name == "leaderCounter5") { leaderImageList.Add(img); } else if (img.Name == "leaderCounter6") { leaderImageList.Add(img); } } switch(type) { case(DwarfType.Crossbowman): hp = 5; originalHp = 5; dwarfImageList = crossbowmanImageList; break; case(DwarfType.Leader): hp = 6; originalHp = 6; dwarfImageList = leaderImageList; break; case(DwarfType.Webber): hp = 4; originalHp = 4; dwarfImageList = webberImageList; break; default: break; } }