Exemplo n.º 1
0
        public static Applicant Random(String ClassName, CompanyInformation info)
        {
            var r = new Applicant();

            r.GenerateRandom(ClassName, 0, info);
            return(r);
        }
Exemplo n.º 2
0
        public Economy(Faction faction, DwarfBux currentMoney, WorldManager worldManager,
                       CompanyInformation CompanyInformation)
        {
            this.WorldManager   = worldManager;
            Company             = Company.GenerateRandom(currentMoney, 1.0m, Company.Sector.Exploration);
            Company.Information = CompanyInformation;
            Company.Assets      = currentMoney;

            CurrentMoney = currentMoney;
            Faction      = faction;
            Market       = new List <Company>
            {
                Company,
                Company.GenerateRandom(1000m, 1.0m, Company.Sector.Exploration),
                Company.GenerateRandom(1200m, 5.0m, Company.Sector.Exploration),
                Company.GenerateRandom(1500m, 10.0m, Company.Sector.Exploration),
                Company.GenerateRandom(1300m, 10.0m, Company.Sector.Manufacturing),
                Company.GenerateRandom(1200m, 10.0m, Company.Sector.Manufacturing),
                Company.GenerateRandom(1500m, 15.0m, Company.Sector.Military),
                Company.GenerateRandom(1300m, 10.0m, Company.Sector.Military),
                Company.GenerateRandom(1200m, 15.0m, Company.Sector.Military),
                Company.GenerateRandom(1500m, 25.0m, Company.Sector.Magic),
                Company.GenerateRandom(1200m, 30.0m, Company.Sector.Magic),
                Company.GenerateRandom(1300m, 40.0m, Company.Sector.Magic),
                Company.GenerateRandom(1500m, 50.0m, Company.Sector.Finance),
                Company.GenerateRandom(1800m, 60.0m, Company.Sector.Finance)
            };

            if (worldManager != null)
            {
                WorldManager.Time.NewDay += Time_NewDay;
            }
        }
Exemplo n.º 3
0
 public EmployeeDisplay(DwarfGUI gui, GUIComponent parent, Faction faction, CompanyInformation company) :
     base(gui, parent)
 {
     Faction = faction;
     Company = company;
     Initialize();
 }
Exemplo n.º 4
0
        public Flag(ComponentManager Manager, Vector3 position, CompanyInformation logo, List <ResourceAmount> resources = null) :
            base(Manager, "Flag", Matrix.CreateTranslation(position), new Vector3(1.0f, 1.0f, 1.0f), Vector3.Zero, new CraftDetails(Manager, "Flag", resources))
        {
            this.Logo = logo;

            Tags.Add("Flag");
            CollisionType = CollisionType.Static;
            CreateCosmeticChildren(Manager);
        }
Exemplo n.º 5
0
        public void GenerateApplicants(CompanyInformation info)
        {
            Applicants = new List <Applicant>();

            foreach (KeyValuePair <JobLibrary.JobType, EmployeeClass> employeeType in JobLibrary.Classes)
            {
                for (int i = 0; i < 5; i++)
                {
                    Applicant applicant = new Applicant();
                    applicant.GenerateRandom(employeeType.Value, 0, info);
                    Applicants.Add(applicant);
                }
            }
        }
Exemplo n.º 6
0
        public static HireDialog Popup(DwarfGUI gui, Faction faction, CompanyInformation company)
        {
            int        w        = gui.Graphics.Viewport.Width - 64;
            int        h        = gui.Graphics.Viewport.Height - 64;
            HireDialog toReturn = new HireDialog(gui, gui.RootComponent)
            {
                Faction     = faction,
                LocalBounds =
                    new Rectangle(gui.Graphics.Viewport.Width / 2 - w / 2, gui.Graphics.Viewport.Height / 2 - h / 2, w, h),
                Company = company
            };

            toReturn.Initialize(ButtonType.OK, "Hire new Employees", "");
            return(toReturn);
        }
Exemplo n.º 7
0
        public void GenerateRandom(String ClassName, int level, CompanyInformation info)
        {
            this.ClassName = ClassName;
            Class          = Library.GetClass(ClassName);
            LevelIndex     = level;
            Gender         = Mating.RandomGender();
            Name           = TextGenerator.GenerateRandom("$firstname", " ", "$lastname");
            List <string> justifications = new List <string>()
            {
                "I have many relevant qualities!",
                "My expereince is extensive!",
                "I really need this job!",
                "I need to get away from it all!",
                "I will be your loyal servant!",
                "I've always wanted to work at " + info.Name + "!",
                "I am a very hard worker!",
                "I am an adventurous soul!"
            };

            CoverLetter =
                TextGenerator.GenerateRandom("${Dear,Hey,Hi,Hello,Sup,Yo}", " ", info.Name, ",\n    ",
                                             "${Please,Do}", " ", "${consider,check out,look at,see,view}", " ", "${my,this}", " ",
                                             "${application for the position of, resume for, request to be a,offer as}", " "
                                             + Level.Name + ". " + justifications[MathFunctions.Random.Next(justifications.Count)] + " \n",
                                             "${Thanks,Sincerely,Yours,--,Always}", ",\n    ", Name);

            if (level > 0)
            {
                FormerProfession = Class.Levels[level - 1].Name;
            }
            else
            {
                FormerProfession = TextGenerator.GenerateRandom("$profession");
            }


            var templates = TextGenerator.GetAtoms(ContentPaths.Text.Templates.location);

            HomeTown = TextGenerator.GenerateRandom(new List <string>(),
                                                    templates[MathFunctions.Random.Next(templates.Count)].ToArray());

            Biography = GenerateBiography(Name, Gender);
        }
Exemplo n.º 8
0
        public Flag(ComponentManager Manager, Vector3 position, CompanyInformation logo) :
            base(Manager, "Flag", Matrix.CreateTranslation(position), new Vector3(1.0f, 1.0f, 1.0f), Vector3.Zero)
        {
            this.Logo = logo;

            Tags.Add("Flag");

            var voxelUnder = VoxelHelpers.FindFirstVoxelBelow(new VoxelHandle(
                                                                  Manager.World.ChunkManager.ChunkData,
                                                                  GlobalVoxelCoordinate.FromVector3(position)));

            if (voxelUnder.IsValid)
            {
                AddChild(new VoxelListener(Manager, Manager.World.ChunkManager,
                                           voxelUnder));
            }

            CollisionType = CollisionManager.CollisionType.Static;
            CreateCosmeticChildren(Manager);
        }
Exemplo n.º 9
0
        public ComponentManager(WorldManager state, CompanyInformation CompanyInformation, List <Faction> natives)
        {
            World                = state;
            Components           = new Dictionary <uint, GameComponent>();
            UpdateableComponents = new Dictionary <Type, List <IUpdateableComponent> >();
            RenderableComponents = new List <IRenderableComponent>();
            Removals             = new List <GameComponent>();
            Additions            = new List <GameComponent>();
            Camera               = null;
            AdditionMutex        = new Mutex();
            RemovalMutex         = new Mutex();
            Factions             = new FactionLibrary();
            if (natives != null && natives.Count > 0)
            {
                Factions.AddFactions(state, natives);
            }
            Factions.Initialize(state, CompanyInformation);
            Point playerOrigin = new Point((int)(World.WorldOrigin.X), (int)(World.WorldOrigin.Y));

            Factions.Factions["Player"].Center     = playerOrigin;
            Factions.Factions["Motherland"].Center = new Point(playerOrigin.X + 50, playerOrigin.Y + 50);
        }
Exemplo n.º 10
0
        public void Initialize(WorldManager world, CompanyInformation CompanyInformation)
        {
            Factions["Player"] = new Faction(world, new OverworldFaction
            {
                Name = "Player",
                Race = "Corporate",
            });

            Factions["Corporate"] = new Faction(world, new OverworldFaction
            {
                Name = "Corporate",
                Race = "Corporate",
                InteractiveFaction = true,
                IsCorporate        = true
            });

            Factions["Herbivore"] = new Faction(world, new OverworldFaction
            {
                Name = "Herbivore",
                Race = "Herbivore"
            });

            Factions["Carnivore"] = new Faction(world, new OverworldFaction
            {
                Name = "Carnivore",
                Race = "Carnivore"
            });

            Factions["Evil"] = new Faction(world, new OverworldFaction
            {
                Name = "Evil",
                Race = "Evil"
            });

            Factions["Dwarves"] = new Faction(world, new OverworldFaction
            {
                Name = "Dwarves",
                Race = "Dwarf"
            });

            Factions["Goblins"] = new Faction(world, new OverworldFaction // Todo: Normalize race name
            {
                Name = "Goblins",
                Race = "Goblins"
            });

            Factions["Elf"] = new Faction(world, new OverworldFaction
            {
                Name = "Elf",
                Race = "Elf"
            });

            Factions["Undead"] = new Faction(world, new OverworldFaction
            {
                Name = "Undead",
                Race = "Undead"
            });

            Factions["Demon"] = new Faction(world, new OverworldFaction
            {
                Name = "Demon",
                Race = "Demon"
            });

            Factions["Molemen"] = new Faction(world, new OverworldFaction
            {
                Name = "Molemen",
                Race = "Molemen"
            });
        }
Exemplo n.º 11
0
        public void Initialize(WorldManager state, CompanyInformation CompanyInformation)
        {
            if (Races == null)
            {
                InitializeRaces();
            }

            if (Factions == null)
            {
                Factions           = new Dictionary <string, Faction>();
                Factions["Player"] = new Faction(state)
                {
                    Name = "Player",
                    Race = Races["Dwarf"]
                };

                Factions["Motherland"] = new Faction(state)
                {
                    Name          = "Motherland",
                    Race          = Races["Dwarf"],
                    IsRaceFaction = false,
                    TradeMoney    = 10000
                };
            }


            Factions["Goblins"] = new Faction(state)
            {
                Name          = "Goblins",
                Race          = Races["Goblins"],
                IsRaceFaction = true
            };

            Factions["Elf"] = new Faction(state)
            {
                Name          = "Elf",
                Race          = Races["Elf"],
                IsRaceFaction = true
            };

            Factions["Undead"] = new Faction(state)
            {
                Name          = "Undead",
                Race          = Races["Undead"],
                IsRaceFaction = true
            };

            Factions["Demon"] = new Faction(state)
            {
                Name          = "Demon",
                Race          = Races["Demon"],
                IsRaceFaction = true
            };

            Factions["Herbivore"] = new Faction(state)
            {
                Name          = "Herbivore",
                Race          = Races["Herbivore"],
                IsRaceFaction = true
            };

            Factions["Carnivore"] = new Faction(state)
            {
                Name          = "Carnivore",
                Race          = Races["Carnivore"],
                IsRaceFaction = true
            };


            Factions["Molemen"] = new Faction(state)
            {
                Name          = "Molemen",
                Race          = Races["Molemen"],
                IsRaceFaction = true
            };

            Factions["Player"].Economy = new Economy(Factions["Player"], 300.0f, state, CompanyInformation);
        }
Exemplo n.º 12
0
        public void Initialize(WorldManager state, CompanyInformation CompanyInformation)
        {
            if (Factions == null)
            {
                Factions           = new Dictionary <string, Faction>();
                Factions["Player"] = new Faction(state)
                {
                    Name = "Player",
                    Race = RaceLibrary.FindRace("Dwarf")
                };

                Factions["The Motherland"] = new Faction(state)
                {
                    Name              = "The Motherland",
                    Race              = RaceLibrary.FindRace("Dwarf"),
                    IsRaceFaction     = false,
                    TradeMoney        = 10000,
                    TerritorySize     = 9999,
                    DistanceToCapital = 600,
                    IsMotherland      = true,
                };
            }


            Factions["Goblins"] = new Faction(state)
            {
                Name          = "Goblins",
                Race          = RaceLibrary.FindRace("Goblins"),
                IsRaceFaction = true
            };

            Factions["Elf"] = new Faction(state)
            {
                Name          = "Elf",
                Race          = RaceLibrary.FindRace("Elf"),
                IsRaceFaction = true
            };

            Factions["Undead"] = new Faction(state)
            {
                Name          = "Undead",
                Race          = RaceLibrary.FindRace("Undead"),
                IsRaceFaction = true
            };

            Factions["Demon"] = new Faction(state)
            {
                Name          = "Demon",
                Race          = RaceLibrary.FindRace("Demon"),
                IsRaceFaction = true
            };

            Factions["Herbivore"] = new Faction(state)
            {
                Name          = "Herbivore",
                Race          = RaceLibrary.FindRace("Herbivore"),
                IsRaceFaction = true
            };

            Factions["Carnivore"] = new Faction(state)
            {
                Name          = "Carnivore",
                Race          = RaceLibrary.FindRace("Carnivore"),
                IsRaceFaction = true
            };


            Factions["Molemen"] = new Faction(state)
            {
                Name          = "Molemen",
                Race          = RaceLibrary.FindRace("Molemen"),
                IsRaceFaction = true
            };

            Factions["Player"].Economy = new Economy(Factions["Player"], 300.0m, state, CompanyInformation);
        }
Exemplo n.º 13
0
        public void GenerateRandom(EmployeeClass employeeClass, int level, CompanyInformation info)
        {
            Class = employeeClass;
            Level = Class.Levels[level];

            Name = TextGenerator.GenerateRandom("$firstname", " ", "$lastname");
            List <string> justifications = new List <string>()
            {
                "I have many relevant qualities!",
                "My expereince is extensive!",
                "I really need this job!",
                "I need to get away from it all!",
                "I will be your loyal servant!",
                "I've always wanted to work at " + info.Name + "!",
                "I am a very hard worker!",
                "I am an adventurous soul!"
            };

            CoverLetter =
                TextGenerator.GenerateRandom("Dear " + info.Name + ",\n",
                                             "${Please,Do}", " consider ", "${my,this}", " application for the position of " + Level.Name +
                                             ". " + justifications[MathFunctions.Random.Next(justifications.Count)] + "\n", "${Thanks,Sincerely,Yours}", ",\n    ", Name);

            if (level > 0)
            {
                FormerProfession = Class.Levels[level - 1].Name;
            }
            else
            {
                FormerProfession = TextGenerator.GenerateRandom("$profession");
            }

            List <string[]> templates = new List <string[]>
            {
                new[]
                {
                    "place",
                    " of the ",
                    "$color",
                    " ",
                    "$noun"
                },
                new[]
                {
                    "$place",
                    " of the ",
                    "$adjective",
                    " ",
                    "$noun"
                },
                new[]
                {
                    "$place",
                    " of the ",
                    "$material",
                    " ",
                    "$noun"
                },
                new[]
                {
                    "$place",
                    " of ",
                    "$noun"
                },
                new[]
                {
                    "$color",
                    " ",
                    "$material",
                    " ",
                    "$place"
                },
                new[]
                {
                    "$adjective",
                    " ",
                    "$place"
                },
                new []
                {
                    "$adjective",
                    "ville"
                },
                new []
                {
                    "$adjective",
                    "burg"
                },
                new []
                {
                    "$lastname",
                    "ton"
                }
            };

            HomeTown = TextGenerator.GenerateRandom(templates[MathFunctions.Random.Next(templates.Count)]);
        }