Ejemplo n.º 1
10
        public User(StateManager stateMgr, API.Geo.World world)
        {
            this.mStateMgr = stateMgr;
            this.mWorld = world;
            this.mTimeSinceGUIOpen = new Timer();

            this.mCameraMan = null;
            this.IsAllowedToMoveCam = true;
            this.IsFreeCamMode = true;
            Camera cam = this.mStateMgr.Camera;
            cam.Position = new Vector3(-203, 633, -183);
            cam.Orientation = new Quaternion(0.3977548f, -0.1096644f, -0.8781486f, -0.2421133f);
            this.mCameraMan = new CameraMan(cam);
            this.mSelectedAllies = new HashSet<VanillaNonPlayer>();
            this.mRandom = new Random();

            this.mFigures = new MOIS.KeyCode[10];
            for (int i = 0; i < 9; i++)
                this.mFigures[i] = (MOIS.KeyCode)System.Enum.Parse(typeof(MOIS.KeyCode), "KC_" + (i + 1));
            this.mFigures[9] = MOIS.KeyCode.KC_0;

            this.mWireCube = this.mStateMgr.SceneMgr.RootSceneNode.CreateChildSceneNode();
            this.mWireCube.AttachObject(StaticRectangle.CreateRectangle(this.mStateMgr.SceneMgr, Vector3.UNIT_SCALE * Cst.CUBE_SIDE));
            this.mWireCube.SetVisible(false);

            this.Inventory = new Inventory(10, 4, new int[] { 3, 0, 1, 2 }, true);
        }
Ejemplo n.º 2
0
        public PlayMenu(StateManager stateMgr, string scenar = "")
            : base(new Vector2(0, 0), new Vector2(404, 404), "play.html", DockStyle.Fill)
        {
            this.mStateMgr = stateMgr;

            this.scenario = scenar;
        }
Ejemplo n.º 3
0
 public BuildingManager(StateManager stateMgr, Island island, RTSManager RTSMgr)
 {
     this.mStateMgr = stateMgr;
     this.mIsland = island;
     this.mRTSManager = RTSMgr;
     this.Buildings = new Dictionary<Vector3, Building>();
 }
Ejemplo n.º 4
0
        public SkyMgr(StateManager stateMgr)
        {
            this.mStateMgr = stateMgr;
            this.mCaelumSystem = new CaelumSystem(this.mStateMgr.Root, this.mStateMgr.SceneMgr, CaelumSystem.CaelumComponent.None);
            this.mListener = new RootLstn(TypeLstn.FrameStarted, mCaelumSystem.FrameStarted);

            this.CreateSky(); this.AddListeners();
        }
Ejemplo n.º 5
0
 protected Building(StateManager stateMgr, Island island, VanillaRTS rts, string selection, Vector3 position)
 {
     this.mStateMgr = stateMgr;
     this.mIsland = island;
     this.RTS = rts;
     this.mColoredBlock = (byte)((this.RTS.Faction == Faction.Blue) ? 32 : 31);
     this.NeededRessources = new Dictionary<byte, int>();
     this.Position = position == -Vector3.UNIT_SCALE ? this.mStateMgr.MainState.User.SelectedBlockPos : position;
     this.Selection = selection;
     this.NeededRessources = this.mStateMgr.MainState.BuildingMgr.GetNeededRessources(this.Selection);
     this.Init();
 }
Ejemplo n.º 6
0
        public MainWorld(StateManager stateMgr)
        {
            this.mAge  = 0;
            this.mSeed = 42;
            this.mName = "SinglePlayer";

            this.mStateMgr = stateMgr;
            this.mStateMgr.SceneMgr.AmbientLight = ColourValue.ZERO;

            GameInfo info = this.mStateMgr.GameInfo;
            if(!info.Load) {
                SceneNode node = this.mStateMgr.SceneMgr.RootSceneNode.CreateChildSceneNode(Vector3.ZERO);
                if      (info.Type == TypeWorld.Plains) { this.mIslandLoaded = new RandomIsland(node, info.Size, new Plains(),    this); }
                else if (info.Type == TypeWorld.Desert) { this.mIslandLoaded = new RandomIsland(node, info.Size, new Desert(),    this); }
                else if (info.Type == TypeWorld.Hills)  { this.mIslandLoaded = new RandomIsland(node, info.Size, new Hills(),     this); }
                else                                    { this.mIslandLoaded = new RandomIsland(node, info.Size, new Mountains(), this); }

                if(info.Scenario != "") {
                    VanillaIsland isl = (VanillaIsland)this.mIslandLoaded;
                    isl.loadStructures(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\SkyLands\\" + info.Scenario + "\\");

                    string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\SkyLands\\" + info.Scenario + "\\";

                    string[] s = File.ReadAllLines(path + "structures.scenario");
                    for(int i = 0; i < s.Length; i++) {
                        string[] ss = File.ReadAllLines(path + s[i] + ".event");

                        for(int j = 0; j < s.Length; j++) {
                            string[] line = s[j].Split(' ');

                            if(line.Length >= 3) {
                                Vector3 v = new Vector3(Convert.ToInt32(line[0]), Convert.ToInt32(line[1]), Convert.ToInt32(line[2]));

                                if(d.ContainsKey(v)) {
                                    d[v].Add(string.Join(" ", line, 3, line.Length - 3));
                                } else {
                                    d.Add(new Vector3(Convert.ToInt32(line[0]), Convert.ToInt32(line[1]), Convert.ToInt32(line[2])),
                                        new List<string> { string.Join(" ", line, 3, line.Length - 3) });
                                }
                            }
                        }
                    }
                }

            } else {
                this.load();
            }
            this.mSkyMgr = new SkyMgr(this.mStateMgr);
        }
Ejemplo n.º 7
0
        public AIRTS(StateManager stateMgr, RTSManager RTSMgr)
            : base(stateMgr, RTSMgr)
        {
            this.Faction = Faction.Red;
            this.mWorld = this.mStateMgr.MainState.World;

            Vector3 isldSize = this.mWorld.getIsland().getSize() * 16;
            this.mRandom = new Random();
            int x = this.mRandom.Next(7, (int)isldSize.x);
            int z = this.mRandom.Next(7, (int)isldSize.z);
            this.mAverageHeight = this.mWorld.getSurfaceHeight(x, z);
            this.mBasePos = new Vector3(x, this.mAverageHeight, z);

            this.mCircle = new Circle(mBasePos);

            this.mNextBuilding = "";
            this.mNbUpdateSkipped = 0;
            this.NbRobotsAllowedToAdd = 0;
            this.NbBuildingsAllowedToAdd = 4;
        }
Ejemplo n.º 8
0
        public StoryEditorWorld(StateManager stateMgr)
        {
            this.mAge  = 0;
            this.mSeed = 42;
            this.mName = "SinglePlayer";

            this.mStateMgr = stateMgr;
            this.mStateMgr.SceneMgr.AmbientLight = ColourValue.ZERO;

            SceneNode node = this.mStateMgr.SceneMgr.RootSceneNode.CreateChildSceneNode(Vector3.ZERO);

            if(File.Exists(stateMgr.StoryInfo.pathToFile) && new FileInfo(stateMgr.StoryInfo.pathToFile).Length != 0) {
                this.mPath = stateMgr.StoryInfo.pathToFile;
                this.mIslandLoaded = new FlatIsland(node, this, stateMgr.StoryInfo.pathToFile);
            } else {
                this.mIslandLoaded = new FlatIsland(node, new Vector2(1, 1), this);
            }

            this.mSkyMgr = new SkyMgr(this.mStateMgr);
        }
Ejemplo n.º 9
0
 public CrystalDrill(StateManager stateMgr, Island island, VanillaRTS rts)
     : base(stateMgr, island, rts, "CD")
 {
 }
Ejemplo n.º 10
0
 public CrystalDrill(StateManager stateMgr, Island island, VanillaRTS rts, Vector3 position)
     : base(stateMgr, island, rts, "RF", position)
 {
 }
Ejemplo n.º 11
0
 public Generator(StateManager stateMgr, Island island, VanillaRTS rts)
     : base(stateMgr, island, rts, "G")
 {
 }
Ejemplo n.º 12
0
 public Generator(StateManager stateMgr, Island island, VanillaRTS rts, Vector3 position)
     : base(stateMgr, island, rts, "G", position)
 {
 }
Ejemplo n.º 13
0
 ///TODO explore for scenarios
 public ScenarioLoader(StateManager stateMgr)
     : base(new Vector2(0, 0), new Vector2(404, 404), "ScenarioEditorChooseScenario.html", DockStyle.Fill)
 {
     this.mStateMgr = stateMgr;
 }
Ejemplo n.º 14
0
 public StoryEditorState(StateManager stateMgr)
     : base(stateMgr, "StoryEditor")
 {
     this.mStateMgr.GameInfo.IsInEditorMode = true;
 }
Ejemplo n.º 15
0
 public RobotFactory(StateManager stateMgr, Island island, VanillaRTS rts)
     : base(stateMgr, island, rts, "RF")
 {
 }
Ejemplo n.º 16
0
 public MenuState(StateManager stateMgr)
     : base(stateMgr, "Menu")
 {
 }
Ejemplo n.º 17
0
 protected MainState(StateManager stateMgr, string name)
     : base(stateMgr, name)
 {
 }
Ejemplo n.º 18
0
 public static void ChangeIsland(TypeWorld newWorld)
 {
     mNewWorld = newWorld;
     StateManager.ChangeIsland();
 }
Ejemplo n.º 19
0
 public HeadQuarter(StateManager stateMgr, Island island, VanillaRTS rts, Vector3 position)
     : base(stateMgr, island, rts, "HQ", position)
 {
 }
Ejemplo n.º 20
0
 public PlayerRTS(StateManager stateMgr,  RTSManager RTSMgr)
     : base(stateMgr, RTSMgr)
 {
     this.Faction = Faction.Blue;
 }
Ejemplo n.º 21
0
 public DeathMenu(StateManager stateMgr)
     : base(new Vector2(0, 0), new Vector2(404, 404), "GameOver.html", DockStyle.Fill)
 {
     this.mStateMgr = stateMgr;
 }
Ejemplo n.º 22
0
 public InGameMenu(StateManager stateMgr)
     : base((OgreForm.InitSize - IMAGE_SIZE) / 2 - Vector2.UNIT_Y * 40, IMAGE_SIZE / Cst.GUI_RATIO, "IngameMenu.html")
 {
     this.mStateMgr = stateMgr;
 }
Ejemplo n.º 23
0
 public StoryEditorState(StateManager stateMgr) : base(stateMgr, "StoryEditor")
 {
     this.mStateMgr.GameInfo.IsInEditorMode = true;
 }
Ejemplo n.º 24
0
 public RTSManager(StateManager stateMgr)
 {
     this.StateMgr = stateMgr;
     this.AIRTS = new AIRTS(this.StateMgr, this);
     this.PlayerRTS = new PlayerRTS(this.StateMgr, this);
 }
Ejemplo n.º 25
0
 public DeathMenuState(StateManager stateMgr)
     : base(stateMgr, "DeathMenu")
 {
 }
Ejemplo n.º 26
0
 public OptionMenu(StateManager stateMgr)
     : base(new Vector2(0, 0), new Vector2(404, 404), "options.html", DockStyle.Fill)
 {
     this.mStateMgr = stateMgr;
 }
Ejemplo n.º 27
0
 static void Main()
 {
     StateManager stateMgr = new StateManager();
     if (stateMgr.Setup())
         stateMgr.Go();
 }
Ejemplo n.º 28
0
 public GameState(StateManager stateMgr) : base(stateMgr, "Game")
 {
 }
Ejemplo n.º 29
0
 public HeadQuarter(StateManager stateMgr, Island island, VanillaRTS rts)
     : base(stateMgr, island, rts, "HQ")
 {
 }
Ejemplo n.º 30
0
 public RobotFactory(StateManager stateMgr, Island island, VanillaRTS rts, Vector3 position)
     : base(stateMgr, island, rts, "RF", position)
 {
 }
Ejemplo n.º 31
0
 public ScenarioCreator(StateManager stateMgr)
     : base(new Vector2(0, 0), new Vector2(437, 900), "scenario.html")
 {
     this.mStateMgr = stateMgr;
 }
Ejemplo n.º 32
0
 public Parser(StateManager s)
 {
     this.st = s;
 }
Ejemplo n.º 33
0
 protected Building(StateManager stateMgr, Island island, VanillaRTS rts, string selection)
     : this(stateMgr, island, rts, selection, -Vector3.UNIT_SCALE)
 {
 }