public HandController(bool isNpc, RPSLSController c) { model = new HandModel(this); view = new HandView(this, isNpc); model.IsNpc = isNpc; rpslsController = c; }
public List <HandView> GetViewHands() { List <HandView> viewOfHands = new List <HandView>(); foreach (HandController hand in playerArray) { HandView handView = hand.getView(); viewOfHands.Add(handView); } return(viewOfHands); }
private void RPSLSView_Load(object sender, EventArgs e) { List <HandView> hands = controller.GetViewHands(); int handWidth = hands.First().Width; int handHeight = hands.First().Height; this.Width = handWidth * hands.Count; this.Height = handHeight; Console.WriteLine("HandSize: " + handWidth + "," + handHeight); Console.WriteLine("RPSLS Size: " + Width + "," + Height); foreach (HandView hand in hands) { HandView tempHand = hand; int xPos = hands.IndexOf(hand) * handWidth; hand.Location = new Point(xPos, 0); Controls.Add(tempHand); } }