Beispiel #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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public void display(Island currentIsland, API.Geo.World currentWorld)
 {
     if (this.faceNumber > 0)
     {
         block.End();
         this.node = this.mIsland.Node.CreateChildSceneNode("MultiBlockNode-" + this.mName);
         this.node.AttachObject(block);
     }
 }
Beispiel #4
0
        public Island(SceneNode node, API.Geo.World currentWorld)
        {
            this.mChunkList = new Dictionary <Vector3, Chunk>();

            this.mNode  = node;
            this.mWorld = currentWorld;

            this.blocksAdded   = new List <PositionFaceAndStatus>();
            this.blocksDeleted = new List <PositionFaceAndStatus>();

            this.mFaceNode = node.CreateChildSceneNode();
        }
        public CollisionMgr(API.Geo.World world, VanillaCharacter charac)
        {
            this.mWorld = world;
            this.mCharac = charac;
            this.mNbrHitStage = 2 + (int)charac.Size.y / Cst.CUBE_SIDE;

            this.mHitRadius = charac.Size.x / 2 * COL_SIDE_MARGE;
            this.mHitDegrees = new Degree[NBR_HIT_POINTS];
            Degree delta = 360 / this.mHitDegrees.Length;
            for (int i = 0; i < this.mHitDegrees.Length; i++)
                this.mHitDegrees[i] = i * delta;
        }
Beispiel #6
0
 public CharacMgr(StateManager stateMgr, API.Geo.World world, User user, BulletManager bulletMgr = null)
 {
     this.mStateMgr   = stateMgr;
     this.mController = stateMgr.Controller;
     this.mWorld      = world;
     this.mUser       = user;
     this.mBulletMgr  = bulletMgr;
     this.mCharacters = new List <VanillaCharacter> [Enum.GetValues(typeof(Faction)).Length];
     for (int i = 0; i < this.mCharacters.Length; i++)
     {
         this.mCharacters[i] = new List <VanillaCharacter>();
     }
 }
Beispiel #7
0
        public CollisionMgr(API.Geo.World world, VanillaCharacter charac)
        {
            this.mWorld       = world;
            this.mCharac      = charac;
            this.mNbrHitStage = 2 + (int)charac.Size.y / Cst.CUBE_SIDE;

            this.mHitRadius  = charac.Size.x / 2 * COL_SIDE_MARGE;
            this.mHitDegrees = new Degree[NBR_HIT_POINTS];
            Degree delta = 360 / this.mHitDegrees.Length;

            for (int i = 0; i < this.mHitDegrees.Length; i++)
            {
                this.mHitDegrees[i] = i * delta;
            }
        }
Beispiel #8
0
        public RandomIsland(SceneNode node, Vector2 size, Biome islandBiome, API.Geo.World currentWorld) : base(node, size, currentWorld)
        {
            this.mBiome = islandBiome;

            ELEVATION.setFrequency(0.2);
            ELEVATION.setLacunarity(1);
            ELEVATION.setNoiseQuality(NoiseQuality.STANDARD);
            ELEVATION.setPersistence(0.7);
            ELEVATION.setOctaveCount(1);

            DETAIL.setFrequency(0.7);
            DETAIL.setLacunarity(1);
            DETAIL.setNoiseQuality(NoiseQuality.STANDARD);
            DETAIL.setPersistence(0.7);
            DETAIL.setOctaveCount(1);

            Multiply multiply = new Multiply();

            multiply.SetSourceModule(0, ROUGHNESS);
            multiply.SetSourceModule(1, DETAIL);

            Add add = new Add();

            add.SetSourceModule(0, multiply);
            add.SetSourceModule(1, ELEVATION);

            SCALE.SetSourceModule(0, add);
            SCALE.setxScale(0.03);
            SCALE.setyScale(0.06);
            SCALE.setzScale(0.03);

            TURBULENCE.SetSourceModule(0, SCALE);
            TURBULENCE.setFrequency(0.01);
            TURBULENCE.setPower(6);
            TURBULENCE.setRoughness(1);

            FINAL.SetSourceModule(0, SCALE);
            FINAL.setLowerBound(-1);
            FINAL.setUpperBound(1);

            this.generate(42);
        }
Beispiel #9
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;
        }
Beispiel #10
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;
        }
 public VanillaMultiBlock(string mat, Island current, API.Geo.World mainWorld, int meshType) : base(mat, current, mainWorld, meshType)
 {
 }
Beispiel #12
0
 public RandomIsland(SceneNode node, Biome islandBiome, API.Geo.World currentWorld) : base(node, currentWorld)
 {
     this.mBiome = islandBiome;
     this.load();
 }
Beispiel #13
0
 public FlatIsland(SceneNode node, API.Geo.World currentWorld, string fileName) : base(node, currentWorld)
 {
     this.load(fileName);
 }
Beispiel #14
0
 public FlatIsland(SceneNode node, Vector2 size, API.Geo.World currentWorld) : base(node, size, currentWorld)
 {
     this.generate(42);
 }
Beispiel #15
0
 public BulletManager(SceneManager sceneMgr, API.Geo.World world)
 {
     this.SceneMgr = sceneMgr;
     this.World    = world;
     this.mBullets = new List <Bullet>();
 }
Beispiel #16
0
 public VanillaIsland(SceneNode node, API.Geo.World currentWorld) : base(node, currentWorld)
 {
 }