Chaos Project

Game Development => Sea of Code => Development Tools => Topic started by: Blizzard on February 10, 2011, 05:08:08 pm

Title: [C#] Class Tools
Post by: Blizzard on February 10, 2011, 05:08:08 pm
Class Tools
Authors: Blizzard
Version: 0.94
Type: Programming Tools



Introduction

Are you sick of having to write code for classes from the beginning? Are you using languages like C++ that have no reflection and serialization becomes a bothersome process to implement? Are you sick of having to manually create all the instances of a class be it by reading a binary file or XML? Your problems will not be solved automatically, but here is something that will make all of these tasks so much easier: Class Tools!

This set of tools was created in C# and supports plugins that can be coded in C# as well.

Class Tools was primarily intended for use on other development platforms and for other programming languages than C#. In other words, you are using a tool created in C# to generate code and data for a project that is being made in another language such as C++, Python, Ruby, Basic, etc.

Class Tools at github + Official Plugins (https://github.com/borisblizzard/classtools)

This work is protected by the following license:
Spoiler: ShowHide
Quote
Copyright (c) Boris Mikic
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



Features

Currently Class Tools consists out of the following applications.

Class Maker Features:


Data Maker Features:



Download

Class Maker v0.94 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v094)
Downloads:
Class Maker v0.94 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v094/ClassMaker.rar)
Plugins:
C++ Source Code Generator v0.93 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v094/Plugins/CppSourceGenerator.dll)
C++ Binary Serialization Code Generator v1.0 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v094/Plugins/CppBinSerializerGenerator.dll)
C++ Lite Serializer Code Generator v1.0 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v094/Plugins/CppLiteserCodeGenerator.dll)

Class Maker v0.93 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v093)
Downloads:
Class Maker v0.93 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v093/ClassMaker.rar)
Plugins:
C++ Source Code Generator v0.93 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v093/Plugins/CppSourceGenerator.dll)
C++ Binary Serialization Code Generator v1.0 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v093/Plugins/CppBinSerializerGenerator.dll)
C++ Lite Serializer Code Generator v1.0 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v093/Plugins/CppLiteserCodeGenerator.dll)

Class Maker v0.92 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v092)
Downloads:
Class Maker v0.92 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v092/ClassMaker.rar)
Plugins:
C++ Source Code Generator v0.92 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v092/Plugins/CppSourceGenerator.dll)
C++ Binary Serialization Code Generator v1.0 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v092/Plugins/CppBinSerializerGenerator.dll)
C++ Lite Serializer Code Generator v1.0 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v092/Plugins/CppLiteserCodeGenerator.dll)

Class Maker v0.91 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v091)
Downloads:
Class Maker v0.91 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v091/ClassMaker.rar)
Plugins:
C++ Source Code Generator v0.91 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v091/Plugins/CppSourceGenerator.dll)
C++ Binary Serialization Code Generator v1.0 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v091/Plugins/CppBinSerializerGenerator.dll)
C++ Lite Serializer Code Generator v1.0 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v091/Plugins/CppLiteserCodeGenerator.dll)

Class Maker v0.9 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v09)
Downloads:
Class Maker v0.9 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v09/ClassMaker.rar)
Plugins:
C++ Source Code Generator v0.9 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v09/Plugins/CppSourceGenerator.dll)
C++ Binary Serialization Code Generator v0.9 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v09/Plugins/CppBinSerializerGenerator.dll)
C++ Lite Serializer Code Generator v0.9 (http://downloads.chaos-project.com/ClassTools/ClassMaker_v09/Plugins/CppLiteserCodeGenerator.dll)

Data Maker v0.94 (http://downloads.chaos-project.com/ClassTools/DataMaker_v094)
Downloads:
Data Maker v0.94 (http://downloads.chaos-project.com/ClassTools/DataMaker_v094/DataMaker.rar)
Plugins:
C++ Lite Serializer Database Dumper v1.0 (http://downloads.chaos-project.com/ClassTools/DataMaker_v094/Plugins/CppLiteserDatabaseDumper.dll)

Data Maker v0.93 (http://downloads.chaos-project.com/ClassTools/DataMaker_v093)
Downloads:
Data Maker v0.93 (http://downloads.chaos-project.com/ClassTools/DataMaker_v093/DataMaker.rar)
Plugins:
C++ Lite Serializer Database Dumper v1.0 (http://downloads.chaos-project.com/ClassTools/DataMaker_v093/Plugins/CppLiteserDatabaseDumper.dll)

Data Maker v0.92 (http://downloads.chaos-project.com/ClassTools/DataMaker_v092)
Downloads:
Data Maker v0.92 (http://downloads.chaos-project.com/ClassTools/DataMaker_v092/DataMaker.rar)
Plugins:
C++ Lite Serializer Database Dumper v1.0 (http://downloads.chaos-project.com/ClassTools/DataMaker_v092/Plugins/CppLiteserDatabaseDumper.dll)

Data Maker v0.91 (http://downloads.chaos-project.com/ClassTools/DataMaker_v091)
Downloads:
Data Maker v0.91 (http://downloads.chaos-project.com/ClassTools/DataMaker_v091/DataMaker.rar)
Plugins:
C++ Lite Serializer Database Dumper v1.0 (http://downloads.chaos-project.com/ClassTools/DataMaker_v091/Plugins/CppLiteserDatabaseDumper.dll)

Data Maker v0.9 (http://downloads.chaos-project.com/ClassTools/DataMaker_v09)
Downloads:
Data Maker v0.9 (http://downloads.chaos-project.com/ClassTools/DataMaker_v09/DataMaker.rar)
Plugins:
C++ Lite Serializer Database Dumper v0.8 (http://downloads.chaos-project.com/ClassTools/DataMaker_v09/Plugins/CppLiteserDatabaseDumper.dll)



Installing Plugins

In order to install a plugin into one of the tools in Class Tools, simply create a folder called "Plugins" in the same folder as the tools executable and copy the DLLs into that folder. The tool will automatically detect the new generator plugins and allow you to use them.



Creating Plugins

If you want to create a plugin yourself:



The ClassTools.Plugin.IPlugin interface defines several properties and methods which you have to implement in your own generator plugin:

Properties:


Methods:


Tool Specific Stuff

Class Maker:


Data Maker:




Compatibility

All tools of Class Tools require Microsoft .NET Framework 3.5 to be installed (comes by default default with Windows XP Service Pack 3 and Windows 7).



Author's Notes

Keep in mind that Class Tools is still a project in development. Currently both Class Maker and Data Maker are available, but both programs are still missing some features.
.NET 3.5 has been selected for usage because it comes by default with Windows XP Service Pack 3 and Windows 7 while it provides a big deal of the .NET functionality and classes for your plugin.
You are not limited to plugin development only. You can also create a full fledged application yourself.

If you find any bugs, please report them here:
http://forum.chaos-project.com
Title: Re: [C#] Class Tools
Post by: winkio on February 10, 2011, 06:14:40 pm
I can see where this would be useful if you were planning ahead and hard a large set of similar classes that you needed to make at once.  I, being a hobbyist programmer, just do everything on the fly, and don't really have a system of organization that would let me take advantage of this.  Still, nice job with the program, and the plugin system :D
Title: Re: [C#] Class Tools
Post by: Blizzard on February 11, 2011, 02:38:54 am
The primary reason I made this was for the automated serialization code generator. xD
But I realized all the additional applications which is why I want to finish the Class Maker and make the Data Maker.
Title: Re: [C#] Class Tools
Post by: G_G on March 03, 2012, 05:27:52 am
Finally got around to creating a Ruby Source Generator plugin. For the most part, this plugins pretty functional and I think I implemented just about everything needed to create classes on the fly. This is the output of a test class I created.
Spoiler: ShowHide
class Enemy

  attr_reader :hp
  attr_reader :max_hp
  attr_accessor :name
  attr_accessor :invincible

  def kill
    @hp = 0
  end

  def initialize(enemy_graphic)
    @hp = 100
    @max_hp = 100
    @name = "Ghost"
    @invincible = false
    @skills = nil
    print "test"
  end

  def hp=(n)
    @hp = [[0, n].max, @max_hp].min
  end

  def hp_percent
    return 0.0 if @max_hp < 1
    return (@hp.to_f / @max_hp.to_f) * 100.0
  end

  def dead?
    return (@hp < 1)
  end

end


Capabilities:


This plugin is made for Class Maker.
Ruby Class Generator (0.9) (http://decisive-media.net/gameguy/RubyClassGen.0.9.zip)

Notes:

Initialize Method
The plugin will automatically generate the initialize method for you. However, if you want to define your own, you can simply add a method to your class, and name it initialize. The plugin will try and detect if you've defined one on your own. The reason I did this is in case you wanted to define parameters for your class. Example, you could set the name to "initialize(enemy_id)" and the plugin will detect that, and generate the initialize method with that, rather than the normal initialize.

Bools, Ints, Floats, and Others
The plugin will try to parse out ints, bools, and floats from the default values. If it fails to do so, it'll just plug the default value in as is. Eventually the plugin will take advantage of the Variable Types drop down box. As for any other possible value like strings or objects, the plugin will not do anything to them. It'll just plug them right in. So if you do plan on setting a string for a default value, don't forget the quotes! If you leave the default value blank, it'll set the variable as nil.

Attributes
The Getter and Setter checkboxes are what defines the attributes and the variable access level. Checking both the Getter and Setter produces an accessor attribute. Just Getter will produce a reader attribute, while Setter will just produce a writer attribute.

If you have any questions or would like the source code, let me know. :3
Title: Re: [C#] Class Tools
Post by: Blizzard on March 05, 2012, 10:48:12 am
Nice work. :3
Nah, I don't think that the source code will be necessary. xD
Title: Re: [C#] Class Tools
Post by: Blizzard on July 28, 2015, 05:25:51 pm
I moved the whole thing to github. Assembla sucks ass now.
Title: Re: [C#] Class Tools
Post by: PhoenixFire on July 30, 2015, 11:52:49 pm
This is the first time I'm seeing this topic, but great work, and love the idea =) I may look into this more, as I'm going to be learning Cpp I think.
Title: Re: [C#] Class Tools
Post by: Blizzard on July 31, 2015, 04:05:50 am
I wrote this in C#, not C++. xD
Title: Re: [C#] Class Tools
Post by: PhoenixFire on August 04, 2015, 06:11:08 pm
I thought I read that it can be used to help write in other languages (I know it's written in c# hahaha... it's right in the title :p  )
Title: Re: [C#] Class Tools
Post by: Ryex on August 05, 2015, 11:15:33 pm
it can prototype classes in other languages, provided there is a plugin to do so.
Title: Re: [C#] Class Tools
Post by: PhoenixFire on August 06, 2015, 01:34:28 pm
Quote from: Ryex on August 05, 2015, 11:15:33 pm
it can prototype classes in other languages, provided there is a plugin to do so.


Ah, okay, gotcha. Either way it's still really cool as a tool.