C# Workshop 3 – ShapeInheritance With Lists

This week’s workshop code is available at: http://devsoc.co.uk/wp-content/uploads/2011/12/ShapeInheritanceWithLists.zip. We covered using Lists in C# to store data, in particular using a List to store different types of objects all derived from a base class. We also covered using a Switch Case to build a basic text menu, which can also be used in C++.

In the new year we will be covering an introduction to NerfCore, so if you haven’t already, head over to http://nerfgames.co.uk/forums and get registered for your engine key.

To test your understanding of this week’s work, go back to the problem set last week and extend it to use the type of text menu we made this week, add a List to store objects, write the ToString overrides and have a go at implementing a Search by Name and BubbleSort. The last two will be a bit of a challenge, but are both manageable, so give them a go!

Meeting Minutes for Wednesday 30th November 2011

Global Game Jam – So far we have about 16 people interested in come to the Global Game Jam in January. If you’re interested in coming, register for a user account at http://globalgamejam.org and email your name and username to admin@devsoc.co.uk so we know who is interested. We’ll probably be going to the event in Birmingham, but we’re waiting for them to register as a host for this year. If Birmingham aren’t running an event this year, we will look at going to Stafford.

Workshops – This week we covered writing slightly more complex classes, inheritance and polymorphism. The example solution is available at http://devsoc.co.uk/2011/12/c-workshop-2-shapeinheritance/, which we will be using next week for our last workshop of term.

TGI Friday – Nick is going to speak to TGIs about securing our table. It is booked for 7pm on the 6th December, please try and arrive a bit early because there are a lot of us to seat. If you have paid a deposit to Nick, £5 will come off your bill at the end of the night.

Tshirts and Hoodies – Nick is dealing with ordering these, if you want one but you aren’t sure if he knows yet, have a word with him to tell him you are interested. Once we have enough to meet the minimum order, we’ll start dealing with money and sizes etc.

Projects – If you have a project idea and want to tell people about it, register for an account here (Link on the left hand bar) and email admin@devsoc.co.uk your name and username so that you can be given author privileges and start sharing news and screenshots etc for your project.

NerfGames forums – If you are interested in playing/beta testing NerfCore or any of the games being made by NerfGames, register on the NerfGames forums at http://nerfgames.co.uk/forums and pm shadow telling him you’re part of DevSoc and your N-Number and you will be added to the DevSoc group. Also follow the instructions on the Get The Engine post to get access to the NerfCore downloads.

 

C# Workshop 2 – ShapeInheritance

This week’s workshop is available at http://devsoc.co.uk/wp-content/uploads/2011/12/ShapeInheritance-fixed.zip. I’ve included a bunch of comments to explain what each part does and also included an example of a second level of inheritance, inheriting the Rectangle from the Square, which inherits from the Shape.

To test if you understand the concepts behind this, try creating your own C# project and creating an abstract Person class to store Name and Age, and then create Staff and Student classes that inherit from the Person class. The Staff class should store data about their office and module that they teach, the student class should have a course that they are enrolled on and a grade for first year.

Next week we will be introducing Lists to store collections of data, Getters and Setters and overriding methods from the C# base object class to make outputting data about an object easier. Don’t worry if this sounds confusing, it’ll make sense by the end of the workshop!