コード例 #1
0
ファイル: CharacterController.cs プロジェクト: kstrasse/NPC
        public ActionResult Index(ClassTypes selectedClass, int level = 1)
        {
            FifthEdCharacter character = new FifthEdCharacter(level);

            character.generate(selectedClass, level);
            return(View(character));
        }
コード例 #2
0
    /// <summary>
    /// Returns the busy time of a Flatmate on basis of type of class attended in minutes.
    /// </summary>
    /// <param name="classtype">Classtype.</param>
    int GetBusyTimeForClassTypeInMinutes(ClassTypes classtype)
    {
        switch (classtype)
        {
        case ClassTypes.Essay:
            return(5);           //return 30;

        case ClassTypes.SeminarPrepration:
            return(60);

        case ClassTypes.Tutorial:
            return(120);

        case ClassTypes.Lecture:
            return(240);

        case ClassTypes.Seminar:
            return(360);

        case ClassTypes.Coursework:
            return(10);

        default:
            return(0);
        }
    }
コード例 #3
0
 public void IsVampire_Test(ActFlags actFlag, RaceTypes race, ClassTypes cls, bool expectedValue)
 {
     _ch.Act.SetBit((int)actFlag);
     _ch.CurrentRace  = race;
     _ch.CurrentClass = cls;
     Assert.That(_ch.IsVampire(), Is.EqualTo(expectedValue));
 }
コード例 #4
0
ファイル: Player.cs プロジェクト: gfriesen98/CShRogue
        /// <summary>
        /// Sets Player classification
        /// </summary>
        /// <param name="name">Class Name</param>
        public void SetPlayerClass(string name)
        {
            switch (name)
            {
            case "Paladin": classType = ClassTypes.Paladin; break;

            case "Theif": classType = ClassTypes.Thief; break;

            case "Warrior": classType = ClassTypes.Warrior; break;

            case "Mage": classType = ClassTypes.Mage; break;

            case "Sorceror": classType = ClassTypes.Sorceror; break;

            case "Archer": classType = ClassTypes.Archer; break;

            case "Merchant": classType = ClassTypes.Merchant; break;

            case "Knight": classType = ClassTypes.Knight; break;

            case "Enchanter": classType = ClassTypes.Enchanter; break;

            default: Console.WriteLine("not in list"); break;
            }
        }
コード例 #5
0
        private void SearchForAttributes(
            Assembly assembly
            , ClassTypes classPart = ClassTypes.Any
            , Type typeToCheck     = null)
        {
            bool shouldSkip = false;

            try
            {
                if (typeToCheck != null)
                {
                    ScanType(typeToCheck, classPart);
                }
                else if (!shouldSkip)
                {
                    if (classPart == ClassTypes.Any || classPart == ClassTypes.Assembly)
                    {
                        foreach (TAttribute attr in assembly.GetCustomAttributes(typeof(TAttribute), false))
                        {
                            Add(attr, assembly, typeof(Assembly), assembly);
                        }
                    }

                    foreach (Type type in assembly.GetTypes())
                    {
                        ScanType(type, classPart);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #6
0
    public BaseClass(Dictionary <string, string> classDictionary)
    {
        string[] delimiter = new string[] { " " };

        _name        = classDictionary["Name"];
        _description = classDictionary["Description"];
        _ID          = int.Parse(classDictionary["ID"]);
        _type        = (ClassTypes)System.Enum.Parse(typeof(BaseClass.ClassTypes), classDictionary["Type"].ToString());
        _stats.Add(new BaseRhetoric());
        _stats.Add(new BaseImage());
        _stats.Add(new BaseDiplomacy());
        _stats.Add(new BaseHealth());
        _stats.Add(new BaseAmbition());
        _stats.Add(new BaseEloquence());

        string[] tempStats = classDictionary["Stats"].Split(delimiter, StringSplitOptions.None);
        for (int i = 0; i < tempStats.Length; i++)
        {
            _stats[i].StatBaseValue     = int.Parse(tempStats[i]);
            _stats[i].StatModifiedValue = int.Parse(tempStats[i]);
        }

        string[] tempAbilities = classDictionary["Abilities"].Split(delimiter, StringSplitOptions.None);
        for (int i = 0; i < tempAbilities.Length; i++)
        {
            _abilities.Add(AbilityDB.abilities[int.Parse(tempAbilities[i]) - 1]);
        }
    }
コード例 #7
0
        public IEnumerable <Tuple <TAttribute, object, Type, Assembly> > ScanForAttributes(
            Assembly assembly
            , ClassTypes section = ClassTypes.Any
            , Type type          = null)
        {
            if (assembly == null)
            {
                throw new ArgumentException(nameof(assembly));
            }

            var props = _targetMap.Where(a => type != null && a.Item3 == type);

            if (props.Count() == 0)
            {
                if (type == null)
                {
                    ScanAssembly(assembly, section);
                }
                else
                {
                    ScanType(type, section);
                }
            }

            return((props.Count() == 0)
                   ? _targetMap
                   : _targetMap.Where(a => type != null && a.Item3 == type));
        }
コード例 #8
0
    public BaseClass(ClassTypes type, List <BaseClass> classes)
    {
        if (type == ClassTypes.GLADHANDER)
        {
            _name        = classes[0].ClassName;
            _description = classes[0].ClassDescription;
            _ID          = classes[0].ClassID;
            _type        = type;
            _stats       = classes[0].ClassStats;
            _abilities   = classes[0].ClassAbilities;
        }

        if (type == ClassTypes.CHIEF)
        {
            _name        = classes[1].ClassName;
            _description = classes[1].ClassDescription;
            _ID          = classes[1].ClassID;
            _type        = type;
            _stats       = classes[1].ClassStats;
            _abilities   = classes[1].ClassAbilities;
        }

        if (type == ClassTypes.SOPHIST)
        {
            _name        = classes[2].ClassName;
            _description = classes[2].ClassDescription;
            _ID          = classes[2].ClassID;
            _type        = type;
            _stats       = classes[2].ClassStats;
            _abilities   = classes[2].ClassAbilities;
        }
    }
コード例 #9
0
        public void InitStructureEnums()
        {
            Console.WriteLine("Initializing Structure Enums...");
            Structure = new Dictionary <string, IEnumerable <MFilesObject> >();

            if (ObjectTypes == null)
            {
                ObjectTypes = new ObjectTypes(DevelopertTool.Vault);
            }
            Structure["Object"] = ObjectTypes;

            if (ClassTypes == null)
            {
                ClassTypes = new ClassTypes(DevelopertTool.Vault);
            }
            Structure["Class"] = ClassTypes;

            if (PropertyDefinitions == null)
            {
                PropertyDefinitions = new PropertyDefinitions(DevelopertTool.Vault);
            }
            Structure["PropertyDefinition"] = PropertyDefinitions;

            if (ValueLists == null)
            {
                ValueLists = new ValueLists(DevelopertTool.Vault);
            }
            // Add later
        }
コード例 #10
0
    float GetEducationPointsForClassType(ClassTypes classtype)
    {
        switch (classtype)
        {
        case ClassTypes.Essay:
            return(5f);

        case ClassTypes.SeminarPrepration:
            return(10f);

        case ClassTypes.Tutorial:
            return(20f);

        case ClassTypes.Lecture:
            return(40f);

        case ClassTypes.Seminar:
            return(80f);

        case ClassTypes.Coursework:
            return(160f);

        default:
            return(0f);
        }
    }
コード例 #11
0
        public void generate(ClassTypes type, int level = 1)
        {
            switch (type)
            {
            case ClassTypes.Fighter:
                this.characterClass = new Fighter(level);
                break;

            case ClassTypes.Rogue:
                this.characterClass = new Rogue(level);
                break;

            default:
                throw new Exception("Cannot find the passed in class");
            }
            this.stat        = new Stat();
            this.statNumbers = stat.randomizeStats(r, 6);
            this.stats       = stat.AssignStats(this.statNumbers, stat.all, characterClass.prioritizedStats);
            this.Bab         = characterClass.babType;

            Strength     = getStatTotal(statType.Strength);
            Dexterity    = getStatTotal(statType.Dexterity);
            Constitution = getStatTotal(statType.Constitution);
            Intelligence = getStatTotal(statType.Intelligence);
            Wisdom       = getStatTotal(statType.Wisdom);
            Charisma     = getStatTotal(statType.Charisma);
        }
コード例 #12
0
 public Course(ushort _id, string _name, int _capacity, int minHours, ClassTypes _type = ClassTypes.Lab)
 {
     CourseID  = _id;
     name      = _name;
     capacity  = _capacity;
     MinHours  = minHours;
     classType = _type;
 }
コード例 #13
0
        private void ScanAssembly(Assembly assembly, ClassTypes classPart = ClassTypes.Any)
        {
            if (assembly == null)
            {
                throw new ArgumentException(nameof(assembly));
            }

            SearchForAttributes(assembly, classPart);
        }
コード例 #14
0
        /// <summary>Gets the type style of the given type name.</summary>
        /// <param name="typeName">The type name.</param>
        /// <returns>The type style.</returns>
        public TypeScriptTypeStyle GetTypeStyle(string typeName)
        {
            if (ClassTypes != null && ClassTypes.Contains(typeName))
            {
                return(TypeScriptTypeStyle.Class);
            }

            return(TypeStyle);
        }
コード例 #15
0
 public BaseClass()
 {
     _name        = "Default";
     _description = "Default";
     _ID          = 0;
     _type        = ClassTypes.NULL;
     _stats       = null;
     _abilities   = null;
 }
コード例 #16
0
        internal ITemplate CreateTemplate(string typeName, object model)
        {
            if (ClassTypes != null && ClassTypes.Contains(typeName))
            {
                return(TemplateFactory.CreateTemplate("TypeScript", "Class", model));
            }

            return(TemplateFactory.CreateTemplate("TypeScript", TypeStyle.ToString(), model));
        }
コード例 #17
0
 public void SendRemoveClassFromCharacter(ClassTypes classType)
 {
     peer.OpCustom(
         (byte)GameOpCode.CustomOp,
         new Dictionary <byte, object>
     {
         { (byte)GameParameters.ControlCode, GameOpCode.RemoveClass },
         { (byte)GameParameters.ClassType, classType }
     },
         true);
 }
コード例 #18
0
        public void CanCast_Test(bool isSpellcaster, ClassTypes clsType, bool expectedValue)
        {
            var classRepo = new GenericRepository <ClassData>();

            classRepo.Add(1, new ClassData(1, "Test")
            {
                IsSpellcaster = isSpellcaster, Type = clsType
            });

            var mockDb = new Mock <IRepositoryManager>();

            mockDb.SetupGet(x => x.CLASSES).Returns(classRepo);

            _ch.CurrentClass = clsType;

            Assert.That(_ch.CanCast(mockDb.Object), Is.EqualTo(expectedValue));
        }
コード例 #19
0
ファイル: Player.cs プロジェクト: gfriesen98/CShRogue
        /// <summary>
        /// Constructs a new instance of a player.
        /// </summary>
        /// <param name="damage">Base Damage</param>
        /// <param name="ac">Base AC</param>
        /// <param name="xp">Experience Points</param>
        /// <param name="speed">Base Speed</param>
        /// <param name="health">Health</param>
        /// <param name="mana">Mana</param>
        /// <param name="firedmg">Fire Damage</param>
        /// <param name="icedmg">Ice Damage</param>
        /// <param name="ltngdmg">Lightning Damage</param>
        /// <param name="holydmg">Holy Damage</param>
        /// <param name="deathdmg">Death Damage</param>
        /// <param name="fireres">Fire Resistance</param>
        /// <param name="iceres">Ice Resistance</param>
        /// <param name="litres">Lightning Resistance</param>
        /// <param name="holyres">Holy Resistance</param>
        /// <param name="deathres">Death Resistance</param>
        /// <param name="swrdsmanship">Swordsmanship</param>
        /// <param name="magicskill">Magic Skill</param>
        /// <param name="small">Small Weapons Skill</param>
        /// <param name="sneak">Sneak Skill</param>
        /// <param name="steal">Steal Skill</param>
        /// <param name="block">Block Skill</param>
        /// <param name="lck">Luck</param>
        /// <param name="classtype">Class Type</param>
        /// <param name="color">Console Color</param>
        /// <param name="baseWeapon">Starting Weapon</param>
        /// <param name="baseArmour">Starting Armour</param>
        /// <param name="name">Player Name</param>
        public Player(int damage, int ac, int xp, int speed, int health, int mana, int firedmg, int icedmg, int ltngdmg, int holydmg, int deathdmg,
                      int fireres, int iceres, int litres, int holyres, int deathres, int swrdsmanship, int magicskill, int small, int sneak, int steal, int block, int lck,
                      ClassTypes classtype, RLColor color, Weapons baseWeapon, Armours baseArmour, string name)
        {
            this.damage             = damage;
            this.armourClass        = ac;
            this.xp                 = xp;
            this.speed              = speed;
            this.health             = health;
            this.mana               = mana;
            this.fireDamage         = firedmg;
            this.iceDamage          = icedmg;
            this.lightningDamage    = ltngdmg;
            this.holyDamage         = holydmg;
            this.deathDamage        = deathdmg;
            this.fireResistance     = fireres;
            this.iceResistance      = iceres;
            this.lightningResistace = litres;
            this.holyResistance     = holyres;
            this.deathResistance    = deathres;

            this.swordsmanship      = swrdsmanship;
            this.smallWeaponsSkills = small;
            this.magicSkill         = magicskill;
            this.sneakingSkill      = sneak;
            this.stealingSkill      = steal;
            this.blockingSkill      = block;
            this.luck = lck;

            this.classType = classtype;

            this.color   = color;
            this.player  = true;
            this.weapons = baseWeapon;
            this.armours = baseArmour;
            inventory    = new Inventory();
            inventory.AddItem(weapons);
            inventory.AddItem(armours);
            this.name   = name;
            this.symbol = '@';
            Symbol      = '@';
            Awareness   = 15;
        }
コード例 #20
0
 /// <summary>
 /// Checks input of Keys 1-4 to select a Building/Class-type
 /// </summary>
 private void SelectClassType()
 {
     if (Input.GetKeyDown(KeyCode.Alpha1))
     {
         selectedType = ClassTypes.Warrior;
     }
     else if (Input.GetKeyDown(KeyCode.Alpha2))
     {
         selectedType = ClassTypes.Ranger;
     }
     else if (Input.GetKeyDown(KeyCode.Alpha3))
     {
         selectedType = ClassTypes.Rogue;
     }
     else if (Input.GetKeyDown(KeyCode.Alpha4))
     {
         selectedType = ClassTypes.Healer;
     }
 }
コード例 #21
0
        public void SendCreateCharacter(
            string characterName,
            RaceTypes race,
            HeroTypes hero,
            ClassTypes characterClass,
            StartBonusTypes bonus)
        {
            var d = new Dictionary <byte, object>
            {
                { (byte)GameParameters.ControlCode, GameOpCode.CreateCharacter },
                { (byte)GameParameters.Name, characterName },
                { (byte)GameParameters.Race, (int)race },
                { (byte)GameParameters.Hero, (int)hero },
                { (byte)GameParameters.StartBonus, (int)bonus },
                { (byte)GameParameters.CharacterClass, (int)characterClass }
            };

            peer.OpCustom((byte)GameOpCode.CustomOp, d, true);
        }
コード例 #22
0
        private void ScanType(Type typeToScan, ClassTypes classPart)
        {
            const BindingFlags memberInfoBinding = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance;

            if (classPart == ClassTypes.Any || classPart == ClassTypes.Type)
            {
                foreach (TAttribute attr in typeToScan.GetCustomAttributes(typeof(TAttribute), false))
                {
                    Add(attr, typeToScan, typeToScan, typeToScan.Assembly);
                }
            }

            foreach (MemberInfo member in typeToScan.GetMembers(memberInfoBinding))
            {
                if (member.MemberType == MemberTypes.Property && (classPart == ClassTypes.Properties | classPart == ClassTypes.Any))
                {
                    foreach (TAttribute attr in member.GetCustomAttributes(typeof(TAttribute), false))
                    {
                        Add(attr, member, typeToScan, typeToScan.Assembly);
                    }
                }

                if (member.MemberType == MemberTypes.Method && (classPart == ClassTypes.Methods | classPart == ClassTypes.Any))
                {
                    foreach (TAttribute attr in member.GetCustomAttributes(typeof(TAttribute), false))
                    {
                        Add(attr, member, typeToScan, typeToScan.Assembly);
                    }
                }

                if (member.MemberType == MemberTypes.Method && (classPart == ClassTypes.Parameters | classPart == ClassTypes.Any))
                {
                    foreach (ParameterInfo parameter in ((MethodInfo)member).GetParameters())
                    {
                        foreach (TAttribute attr in parameter.GetCustomAttributes(typeof(TAttribute), false))
                        {
                            Add(attr, parameter, typeToScan, typeToScan.Assembly);
                        }
                    }
                }
            }
        }
コード例 #23
0
        private void ButtonRefreshTypes_Click(object sender, RoutedEventArgs e)
        {
            ClassTypes.Clear();

            foreach (DMSType dmsType in Enum.GetValues(typeof(DMSType)))
            {
                if (dmsType == DMSType.MASK_TYPE)
                {
                    continue;
                }

                ModelCode dmsTypesModelCode = modelResourcesDesc.GetModelCodeFromType(dmsType);
                ClassTypes.Add(new ClassTypeViewModel()
                {
                    ClassType = dmsTypesModelCode
                });
            }

            SelectedType = null;
        }
コード例 #24
0
ファイル: bodypart.cs プロジェクト: thantos/ProteusCreature
        public bodypart(ClassTypes ty, PartTypes pt, string name = " ",double str = 0, double def = 0, double intel = 0, double agil = 0, double end = 0)
        {
            Name = name;
            Abilities = new List<ability>();

            Class = ty;
            Part = pt;
            ClassPart = (ClassPartTypes)Enum.Parse(typeof(ClassPartTypes),Class.ToString() + Part.ToString());
            if (str + agil + def + intel + end != 0)
            {
                ability tempAbility = new ability("Base", new List<effect>()
                    {
                    new effect(Stats.statsType.STRENGTH, str, -1, false, true, " ", this.ClassPart),
                    new effect(Stats.statsType.AGILITY, agil, -1, false, true, " ", this.ClassPart),
                    new effect(Stats.statsType.INTELLIGENCE, intel, -1, false, true, " ", this.ClassPart),
                    new effect(Stats.statsType.ENDURANCE, end, -1, false, true, " ", this.ClassPart),
                    new effect(Stats.statsType.DEFENCE, def, -1, false, true, " ",this.ClassPart)
                    }, true, true, new mastery(), new Stats());
                this.AddAbility(tempAbility);
            }
        }
コード例 #25
0
        public Dictionary <object, Assembly> ScanAssembliesForObjects(
            string nameToCheckFor
            , string[] assembliesToLookFor   = null
            , string[] assembliesToSkip      = null
            , ClassTypes classType           = ClassTypes.Any
            , Func <dynamic, bool> predicate = null)
        {
            Dictionary <object, Assembly> result = null;

            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                SearchForObject(assembly, nameToCheckFor, out object obj, assembliesToLookFor, assembliesToSkip, classType, predicate);

                if (result != null)
                {
                    result.Add(obj, assembly);
                }
            }

            return(result);
        }
コード例 #26
0
        public List <ClassTypes> GetClassTypes()
        {
            List <ClassTypes> classTypes = new List <ClassTypes>();

            BigQueryResults res = Results[0];

            foreach (BigQueryRow row in res)
            {
                ClassTypes types = new ClassTypes
                {
                    id          = Convert.ToInt32(row["id"]),
                    classType   = row["name"].ToString(),
                    conceptId   = Convert.ToInt32(row["conceptId"]),
                    className   = (row["className"]).ToString(),
                    description = row["description"].ToString(),
                };

                classTypes.Add(types);
            }

            return(classTypes);
        }
コード例 #27
0
        public Ship(BinaryReader r)
        {
            // data

            Id          = r.ReadInt32();
            LockID      = r.ReadInt32();
            OwnerID     = r.ReadInt32();
            IsInAuction = r.ReadByte();
            Race        = (Races)r.ReadInt32();
            ClassType   = (ClassTypes)r.ReadInt32();
            BPV         = r.ReadInt32();
            EPV         = r.ReadInt32();

            Utils.ReadString(r, out ShipClassName);
            Utils.ReadString(r, out Name);

            TurnCreated = r.ReadInt32();

            Damage   = new ShipDamage(r);
            Stores   = new ShipStores(r);
            Officers = new ShipOfficers(r);

            Flags = r.ReadInt32();

            // helpers

            int c = r.ReadInt32();

            if (c == 0)
            {
                ShipCache = null;
            }
            else
            {
                ShipCache = r.ReadBytes(c);
            }
        }
コード例 #28
0
        public object ScanAssembliesForObject(
            string nameToCheckFor
            , out Assembly assembly
            , string[] assembliesToLookFor   = null
            , string[] assembliesToSkip      = null
            , ClassTypes classType           = ClassTypes.Any
            , Func <dynamic, bool> predicate = null)
        {
            assembly = null;
            object result = null;

            foreach (Assembly _assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                SearchForObject(_assembly, nameToCheckFor, out result, assembliesToLookFor, assembliesToSkip, classType, predicate);

                if (result != null)
                {
                    assembly = _assembly;
                    break;
                }
            }

            return(result);
        }
コード例 #29
0
        internal ITemplate CreateTemplate(string typeName)
        {
            if (ClassTypes != null && ClassTypes.Contains(typeName))
            {
                return(new ClassTemplate());
            }

            if (TypeStyle == TypeScriptTypeStyle.Interface)
            {
                return(new InterfaceTemplate());
            }

            if (TypeStyle == TypeScriptTypeStyle.Class)
            {
                return(new ClassTemplate());
            }

            if (TypeStyle == TypeScriptTypeStyle.KnockoutClass)
            {
                return(new KnockoutClassTemplate());
            }

            throw new NotImplementedException();
        }
コード例 #30
0
 public static string GetClassName(this ClassTypes classType)
 {
     return(Enum.GetName(typeof(ClassTypes), classType));
 }
コード例 #31
0
ファイル: SpellParser.cs プロジェクト: draek/circle-sharp
        private void SpellLevel(SpellDefinitions def, ClassTypes clas, int level)
        {
            bool bad = false;

            if (level < 1 || level > GlobalConstants.LVL_IMPL)
            {
                Log ("SYSERR: Assigning '" + SkillName (def) + "' to illegal level " + level + "/" + GlobalConstants.LVL_IMPL + ".");
                bad = true;
            }

            if (!bad)
            {
                _spells[def].MinimumLevel[(int)clas] = level;
            }
        }
コード例 #32
0
 private static string GetClassContent(string classNamespace, string className, ClassTypes classType)
 {
     return(classContent.Replace("ClassNamespace", classNamespace).Replace("ClassName", className).Replace("ClassType", classType.ToString().ToLower()));
 }
コード例 #33
0
    void BuildClassesIntoNamespace (CodeDomProvider provider, CodeNamespace ns, string name,
            ClassTypes classType, TypeAttributes attributes) {

        CodeTypeDeclaration class1 = new CodeTypeDeclaration();
        class1.TypeAttributes = attributes;
        class1.Name = name;
        class1.IsPartial = true;
        if (classType == ClassTypes.Struct)
            class1.IsStruct = true;
        else if (classType == ClassTypes.Interface)
            class1.IsInterface = true;
        else
            class1.IsClass = true;

        ns.Types.Add(class1);

        class1.Members.Add (new CodeMemberField (typeof (int), "field1"));

        CodeMemberMethod fooMethod1 = new CodeMemberMethod();
        fooMethod1.Name = "Foo1";
        fooMethod1.Attributes = MemberAttributes.Public | MemberAttributes.Final ;
        fooMethod1.ReturnType = new CodeTypeReference(typeof(int));
        fooMethod1.Statements.Add(new CodeMethodReturnStatement(new CodePrimitiveExpression(1)));
        class1.Members.Add(fooMethod1);

        CodeMemberMethod methodMain =  new CodeMemberMethod ();
        methodMain.Name = "MainMethod";
        if (attributes != TypeAttributes.Abstract) { 
            methodMain.Statements.Add(
                new CodeVariableDeclarationStatement(
                new CodeTypeReference(name), "test1",
                new CodeObjectCreateExpression(new CodeTypeReference(name))));

            methodMain.Statements.Add( 
                new CodeExpressionStatement( 
                new CodeMethodInvokeExpression( 
                new CodeMethodReferenceExpression(
                new CodeVariableReferenceExpression ("test1"), "Foo1"), new CodeExpression[0])));

            methodMain.Statements.Add( 
                new CodeExpressionStatement( 
                new CodeMethodInvokeExpression( 
                new CodeMethodReferenceExpression(
                new CodeVariableReferenceExpression("test1"), "Foo2"), new CodeExpression[0])));
        }
        class1.Members.Add(methodMain);
        
        CodeTypeDeclaration class2 = new CodeTypeDeclaration();
        class2.TypeAttributes = attributes;
        class2.Name = name;
        class2.IsPartial = true; 	
        if (classType == ClassTypes.Struct)
            class2.IsStruct = true;
        else if (classType == ClassTypes.Interface)
            class2.IsInterface = true;
        else
            class2.IsClass = true;

        ns.Types.Add(class2);

        class2.Members.Add (new CodeMemberField (typeof (int), "field2"));

        CodeMemberMethod fooMethod2 = new CodeMemberMethod();
        fooMethod2.Name = "Foo2";
        fooMethod2.Attributes = MemberAttributes.Public | MemberAttributes.Final;
        fooMethod2.ReturnType = new CodeTypeReference(typeof(int));
        fooMethod2.Statements.Add(new CodeMethodReturnStatement(new CodePrimitiveExpression(2)));
        class2.Members.Add(fooMethod2);
    }