Exemplo n.º 1
0
        public override bool IsCustomShapeImplemented(Shape.Type shapeType)
        {
            //if( shapeType == Shape.Type._Custom1 )
            //	return true;

            return(false);
        }
Exemplo n.º 2
0
        protected override Shape OnCreateCustomShape(Shape.Type shapeType)
        {
            if (shapeType == Shape.Type._Custom1)
            {
                return(new _Custom1Shape());
            }

            return(null);
        }
Exemplo n.º 3
0
        // Adds a shape to the list of shapes
        private void AddShape(Shape.Type type, float x, float y)
        {
            this.selected = null;;
            switch (type)
            {
            case Shape.Type.Rect:
                Rect r = new Rect(x, y, rand.Next(maxRandDim),
                                  rand.Next(maxRandDim), this.fill, this.outline, this.room, Brushes.DarkGray);
                if (this.mode == Form1.Connectivity.Offline)
                {
                    this.offlineShapes.Add(r);
                }
                else
                {
                    this.com.SendMessage(r.SendShape("Add", this.selectedIndex, this.username));
                }
                break;

            case Shape.Type.Square:
                Square s = new Square(x, y, rand.Next(maxRandDim),
                                      this.fill, this.outline, this.room, Brushes.DarkGray);
                if (this.mode == Form1.Connectivity.Offline)
                {
                    this.offlineShapes.Add(s);
                }
                else
                {
                    this.com.SendMessage(s.SendShape("Add", this.selectedIndex, this.username));
                }
                break;

            case Shape.Type.Oval:
                Oval o = new Oval(x, y, rand.Next(maxRandDim),
                                  rand.Next(maxRandDim), this.fill, this.outline, this.room, Brushes.DarkGray);
                if (this.mode == Form1.Connectivity.Offline)
                {
                    this.offlineShapes.Add(o);
                }
                else
                {
                    this.com.SendMessage(o.SendShape("Add", this.selectedIndex, this.username));
                }
                break;

            case Shape.Type.Circle:
                Circle c = new Circle(x, y, rand.Next(maxRandDim),
                                      this.fill, this.outline, this.room, Brushes.DarkGray);
                if (this.mode == Form1.Connectivity.Offline)
                {
                    this.offlineShapes.Add(c);
                }
                else
                {
                    this.com.SendMessage(c.SendShape("Add", this.selectedIndex, this.username));
                }
                break;

            case Shape.Type.Triangle:
                Triangle t = new Triangle(x, y, rand.Next(maxRandDim),
                                          rand.Next(maxRandDim), this.fill, this.outline, this.room, Brushes.DarkGray);
                if (this.mode == Form1.Connectivity.Offline)
                {
                    this.offlineShapes.Add(t);
                }
                else
                {
                    this.com.SendMessage(t.SendShape("Add", this.selectedIndex, this.username));
                }
                break;

            default:
                break;
            }
        }
Exemplo n.º 4
0
 protected override Shape OnCreateCustomShape(Shape.Type shapeType)
 {
     return(null);
 }
Exemplo n.º 5
0
 public override bool IsCustomShapeImplemented(Shape.Type shapeType)
 {
     return(false);
 }
Exemplo n.º 6
0
 public static void addCollisionTest(Shape.Type t1, Shape.Type t2, CollisionTest test)
 {
     collisionTests[new KeyValuePair <Type, Type>(t1, t2)] = new CollisionTest(test);
 }