Ejemplo n.º 1
0
 public void AddFigure(FigureUnit item)
 {
     if (this.isLaserOff != null)
     {
         item.IsLaserOff = this.isLaserOff.Value;
         this.isLaserOff = null;
     }
     this.figureCollection.Add(item);
     this.figureMap.Add(item.Id, item);
     this.OnAdd?.Invoke(item);
 }
Ejemplo n.º 2
0
        public FigureUnit Take(string id)
        {
            FigureUnit figure = null;

            try
            {
                var temp = this.figureMap[id];
                figure = CopyUtil.DeepCopy <FigureUnit>(temp);
            }
            catch
            {
            }
            return(figure);
        }
Ejemplo n.º 3
0
 public void Update(string id, FigureUnit item)
 {
     try
     {
         var figure = this.figureMap[id];
         int index  = this.figureCollection.IndexOf(figure);
         this.figureCollection[index] = item;
         this.figureMap[id]           = item;
         this.OnUpdate?.Invoke(item);
     }
     catch
     {
     }
 }