/// <summary> /// constructor /// </summary> /// <param name="client"></param> public Model(TCPClient client) { this.IP = ConfigurationManager.AppSettings["IP"]; this.Port = Int32.Parse(ConfigurationManager.AppSettings["Port"]); this.Client = client; this.Width = Int32.Parse(ConfigurationManager.AppSettings["Width"]); this.Heigth = Int32.Parse(ConfigurationManager.AppSettings["Height"]); Connection = false; NeedClue = false; //clue rec to stay hidden for now Client.UpdateModel += delegate() //we receive new data and we prossening it { string ans = Client.ReceiveData(); ser = new ConvertFromJson(ans); FindType(ser.Type); }; connect(IP, Port); }