public Worker(PanoramaPage1 p, Grid dragonGrid, Grid dwarfsGrid, Grid boardGrid, Grid handGrid,Game g,Image library, Image playedCard) { page=p; this.dragonGrid = dragonGrid; this.dwarfsGrid = dwarfsGrid; this.boardGrid = boardGrid; this.handGrid = handGrid; this.libraryImage = library; this.playedCardImage = playedCard; Dwarf leader = new Dwarf(DwarfType.Leader, new Point(1, -2)); Dwarf crossbowman = new Dwarf(DwarfType.Crossbowman, new Point(-2, 1)); Dwarf webber = new Dwarf(DwarfType.Webber, new Point(1, 1)); Dragon dragon = new Dragon(new Point(0, 0)); figures = new List<Figure>(); selectedFigure = null; figures.Add(leader); figures.Add(crossbowman); figures.Add(webber); figures.Add(dragon); game = g; game.Leader = leader; game.Webber = webber; game.Crossbowman = crossbowman; game.Dragon = dragon; game.ActionsLeft = 1; foreach (Figure f in figures) { Hex.GetHexByAxialCoordinates(game.Board.Hexs, f.Position).Figure = f; } }
public static Hex GetHexByFigure(List<Hex> hexs, Figure f) { foreach(Hex h in hexs) { if(h.figure ==f) { return h; } } return null; }