private bool UpdateFlop(IDatavObj obj) { Flop flop = obj as Flop; var existFlops = Flops.Where(p => p.Name() == flop.Name()); if (existFlops.Any()) { Flop existFlop = existFlops.First(); if (existFlop.Same(flop)) { return(false); } else { Logger.Log($"[Datav][{Name}]更新翻牌器:"); Logger.Log(flop.ToString()); Logger.Log($"[Datav][{Name}]--------------"); Flops.Remove(existFlop); Flops.Add(flop); return(true); } } else { Flops.Add(flop); return(true); } }
private bool AddFlop(IDatavObj obj) { Flop flop = obj as Flop; var existFlops = Flops.Where(p => p.Name() == flop.Name()); if (existFlops.Any()) { return(false); } else { Logger.Log($"[Datav][{Name}]创建翻牌器:"); Logger.Log(flop.ToString()); Logger.Log($"[Datav][{Name}]--------------"); Flops.Add(flop); return(true); } }