예제 #1
0
 public void MoveView(DView view, int newX, int newY)
 {
     view.X = newX;
     view.Y = newY;
     views.Remove(view);
     views.AddLast(view);
 }
예제 #2
0
        public void onScreenClick(int x, int y)
        {
            if(viewCollection.GetView(x, y)==null)
            {
                DView view = null;
                Random rand=new Random(DateTime.Now.Millisecond);
                int radius = minRadius + (int)(rand.NextDouble() * (maxRadius - minRadius));
                int screenX = Convert.ToInt32(screenWidth * rand.NextDouble());
                int screenY = Convert.ToInt32(screenHeight * rand.NextDouble());
                if ( rand.Next(10)%2 == 1)//circle
                {
                    view = new DView(DViewType.Circle, patternCache.DequeueColor(), screenX, screenY, radius);
                }else //square
                {
                    view = new DView(DViewType.Square, patternCache.DequeuePattern(), screenX, screenY, radius);
                }
                viewCollection.AddView(view);

                surfaceViewRefresher.Refresh();
            }
        }
예제 #3
0
 public void UpdateView(DView view, DPattern newPattern)
 {
     view.Pattern = newPattern;
 }
예제 #4
0
 public void AddView(DView view)
 {
     views.AddLast(view);
 }