Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Acuarela.Primitives
- {
- // Defining a Pixel
- public class iPixel
- {
- // Fields | Attirbutes | Caracteristicas
- int x, y;
- // Properties
- public int X
- {
- // Get
- get{
- return this.x;
- }
- // Set
- set{
- if(value < 0)
- {
- throw new Exception("> Chico malo las coordenadas no pueden ser menores que cero");
- }
- this.x = value;
- }
- }
- public int Y
- {
- // Get
- get{
- return this.y;
- }
- // Set
- set{
- if(value < 0)
- {
- throw new Exception("> Chico malo las coordenadas no pueden ser menores que cero");
- }
- this.y = value;
- }
- }
- // Constructores
- public iPixel(){}
- public iPixel(int x, int y){
- this.X = x;
- this.Y = y;
- }
- }
- // Defining a rectangle class
- public class iRectangle
- {
- // Fields
- iPixel pixel1 = new iPixel(), pixel2 = new iPixel();
- // Rectangle Properties
- public iPixel Pixel1
- {
- get{
- return this.pixel1;
- }
- set{
- this.pixel1 = value;
- }
- }
- public iPixel Pixel2
- {
- get{
- return this.pixel2;
- }
- set{
- this.pixel2 = value;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment