Пример #1
0
        public static void Main()
        {
            //This is setting the value of my 'map' varaiable to a new instance of my 'Map' class with the values 8 and 5 (i.e. newing up my class)
            var mymap = new Map(8, 5);

            try
            {
                var mypoint = new MapLocation(20, 20, mymap);
            }
            catch (Exception error)
            {
                Console.WriteLine(error);
            }

            //These are new instances of my Classes and 'mytower' is the object of my 'Tower' class.
            //By creating the 'mytower' object, it has created an 'instance' of the 'Tower' class.
            //The term for creating an object from a class is called 'Instantiation', I've just instantiated an object from the tower class
            var mytower = new Tower(2);

            var towerplace = mytower.Place(5, 2);

            var invader = new Invader(4, 3);

            var path = new Path(4, 3);
        }