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); }
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; }
public BuildingManager(StateManager stateMgr, Island island, RTSManager RTSMgr) { this.mStateMgr = stateMgr; this.mIsland = island; this.mRTSManager = RTSMgr; this.Buildings = new Dictionary<Vector3, Building>(); }
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(); }
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(); }
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); }
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; }
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); }
public CrystalDrill(StateManager stateMgr, Island island, VanillaRTS rts) : base(stateMgr, island, rts, "CD") { }
public CrystalDrill(StateManager stateMgr, Island island, VanillaRTS rts, Vector3 position) : base(stateMgr, island, rts, "RF", position) { }
public Generator(StateManager stateMgr, Island island, VanillaRTS rts) : base(stateMgr, island, rts, "G") { }
public Generator(StateManager stateMgr, Island island, VanillaRTS rts, Vector3 position) : base(stateMgr, island, rts, "G", position) { }
///TODO explore for scenarios public ScenarioLoader(StateManager stateMgr) : base(new Vector2(0, 0), new Vector2(404, 404), "ScenarioEditorChooseScenario.html", DockStyle.Fill) { this.mStateMgr = stateMgr; }
public StoryEditorState(StateManager stateMgr) : base(stateMgr, "StoryEditor") { this.mStateMgr.GameInfo.IsInEditorMode = true; }
public RobotFactory(StateManager stateMgr, Island island, VanillaRTS rts) : base(stateMgr, island, rts, "RF") { }
public MenuState(StateManager stateMgr) : base(stateMgr, "Menu") { }
protected MainState(StateManager stateMgr, string name) : base(stateMgr, name) { }
public static void ChangeIsland(TypeWorld newWorld) { mNewWorld = newWorld; StateManager.ChangeIsland(); }
public HeadQuarter(StateManager stateMgr, Island island, VanillaRTS rts, Vector3 position) : base(stateMgr, island, rts, "HQ", position) { }
public PlayerRTS(StateManager stateMgr, RTSManager RTSMgr) : base(stateMgr, RTSMgr) { this.Faction = Faction.Blue; }
public DeathMenu(StateManager stateMgr) : base(new Vector2(0, 0), new Vector2(404, 404), "GameOver.html", DockStyle.Fill) { this.mStateMgr = stateMgr; }
public InGameMenu(StateManager stateMgr) : base((OgreForm.InitSize - IMAGE_SIZE) / 2 - Vector2.UNIT_Y * 40, IMAGE_SIZE / Cst.GUI_RATIO, "IngameMenu.html") { this.mStateMgr = stateMgr; }
public RTSManager(StateManager stateMgr) { this.StateMgr = stateMgr; this.AIRTS = new AIRTS(this.StateMgr, this); this.PlayerRTS = new PlayerRTS(this.StateMgr, this); }
public DeathMenuState(StateManager stateMgr) : base(stateMgr, "DeathMenu") { }
public OptionMenu(StateManager stateMgr) : base(new Vector2(0, 0), new Vector2(404, 404), "options.html", DockStyle.Fill) { this.mStateMgr = stateMgr; }
static void Main() { StateManager stateMgr = new StateManager(); if (stateMgr.Setup()) stateMgr.Go(); }
public GameState(StateManager stateMgr) : base(stateMgr, "Game") { }
public HeadQuarter(StateManager stateMgr, Island island, VanillaRTS rts) : base(stateMgr, island, rts, "HQ") { }
public RobotFactory(StateManager stateMgr, Island island, VanillaRTS rts, Vector3 position) : base(stateMgr, island, rts, "RF", position) { }
public ScenarioCreator(StateManager stateMgr) : base(new Vector2(0, 0), new Vector2(437, 900), "scenario.html") { this.mStateMgr = stateMgr; }
public Parser(StateManager s) { this.st = s; }
protected Building(StateManager stateMgr, Island island, VanillaRTS rts, string selection) : this(stateMgr, island, rts, selection, -Vector3.UNIT_SCALE) { }