Пример #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);
        }
Пример #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;
        }
Пример #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>();
 }
Пример #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();
        }
Пример #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();
 }
Пример #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);
        }
Пример #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;
        }
Пример #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);
        }
Пример #9
0
 public CrystalDrill(StateManager stateMgr, Island island, VanillaRTS rts)
     : base(stateMgr, island, rts, "CD")
 {
 }
Пример #10
0
 public CrystalDrill(StateManager stateMgr, Island island, VanillaRTS rts, Vector3 position)
     : base(stateMgr, island, rts, "RF", position)
 {
 }
Пример #11
0
 public Generator(StateManager stateMgr, Island island, VanillaRTS rts)
     : base(stateMgr, island, rts, "G")
 {
 }
Пример #12
0
 public Generator(StateManager stateMgr, Island island, VanillaRTS rts, Vector3 position)
     : base(stateMgr, island, rts, "G", position)
 {
 }
Пример #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;
 }
Пример #14
0
 public StoryEditorState(StateManager stateMgr)
     : base(stateMgr, "StoryEditor")
 {
     this.mStateMgr.GameInfo.IsInEditorMode = true;
 }
Пример #15
0
 public RobotFactory(StateManager stateMgr, Island island, VanillaRTS rts)
     : base(stateMgr, island, rts, "RF")
 {
 }
Пример #16
0
 public MenuState(StateManager stateMgr)
     : base(stateMgr, "Menu")
 {
 }
Пример #17
0
 protected MainState(StateManager stateMgr, string name)
     : base(stateMgr, name)
 {
 }
Пример #18
0
 public static void ChangeIsland(TypeWorld newWorld)
 {
     mNewWorld = newWorld;
     StateManager.ChangeIsland();
 }
Пример #19
0
 public HeadQuarter(StateManager stateMgr, Island island, VanillaRTS rts, Vector3 position)
     : base(stateMgr, island, rts, "HQ", position)
 {
 }
Пример #20
0
 public PlayerRTS(StateManager stateMgr,  RTSManager RTSMgr)
     : base(stateMgr, RTSMgr)
 {
     this.Faction = Faction.Blue;
 }
Пример #21
0
 public DeathMenu(StateManager stateMgr)
     : base(new Vector2(0, 0), new Vector2(404, 404), "GameOver.html", DockStyle.Fill)
 {
     this.mStateMgr = stateMgr;
 }
Пример #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;
 }
Пример #23
0
 public StoryEditorState(StateManager stateMgr) : base(stateMgr, "StoryEditor")
 {
     this.mStateMgr.GameInfo.IsInEditorMode = true;
 }
Пример #24
0
 public RTSManager(StateManager stateMgr)
 {
     this.StateMgr = stateMgr;
     this.AIRTS = new AIRTS(this.StateMgr, this);
     this.PlayerRTS = new PlayerRTS(this.StateMgr, this);
 }
Пример #25
0
 public DeathMenuState(StateManager stateMgr)
     : base(stateMgr, "DeathMenu")
 {
 }
Пример #26
0
 public OptionMenu(StateManager stateMgr)
     : base(new Vector2(0, 0), new Vector2(404, 404), "options.html", DockStyle.Fill)
 {
     this.mStateMgr = stateMgr;
 }
Пример #27
0
 static void Main()
 {
     StateManager stateMgr = new StateManager();
     if (stateMgr.Setup())
         stateMgr.Go();
 }
Пример #28
0
 public GameState(StateManager stateMgr) : base(stateMgr, "Game")
 {
 }
Пример #29
0
 public HeadQuarter(StateManager stateMgr, Island island, VanillaRTS rts)
     : base(stateMgr, island, rts, "HQ")
 {
 }
Пример #30
0
 public RobotFactory(StateManager stateMgr, Island island, VanillaRTS rts, Vector3 position)
     : base(stateMgr, island, rts, "RF", position)
 {
 }
Пример #31
0
 public ScenarioCreator(StateManager stateMgr)
     : base(new Vector2(0, 0), new Vector2(437, 900), "scenario.html")
 {
     this.mStateMgr = stateMgr;
 }
Пример #32
0
 public Parser(StateManager s)
 {
     this.st = s;
 }
Пример #33
0
 protected Building(StateManager stateMgr, Island island, VanillaRTS rts, string selection)
     : this(stateMgr, island, rts, selection, -Vector3.UNIT_SCALE)
 {
 }