Esempio n. 1
0
 /// <summary>
 /// how to activate this mode
 /// </summary>
 /// <param name="entity"></param>
 public void Activate(Entity entity)
 {
     if (entity is CaveBlueprint)
     {
         this.cave = (CaveBlueprint)entity;
     }
     else
     {
         this.scene.DisposeCurrentModeHandler();
     }
 }
Esempio n. 2
0
File: Scene.cs Progetto: XF9/Fenrir
        /// <summary>
        /// prepares a new world
        /// </summary>
        public void InitializeWorld()
        {
            // initialize variables
            this.blocks = new Dictionary <Point, Block> [this.Properties.MaxBlockDepth];

            for (int i = 0; i < this.Properties.MaxBlockDepth; i++)
            {
                this.blocks[i] = new Dictionary <Point, Block>();
            }

            this.markers   = new Dictionary <Point, Marker>();
            this.units     = new List <Entities.Unit>();
            this.buildings = new List <Building>();
            this.caves     = new List <Cave>();

            this.units.Add(new Entities.Unit(DataIdentifier.modelPlayerUnit, new Vector3(0.5f, 0.5f, 0.5f), new Vector3(0, 4, -1), "Herbert"));
            this.units.Add(new Entities.Unit(DataIdentifier.modelPlayerUnit, new Vector3(0.5f, 0.5f, 0.5f), new Vector3(-2, 4, -1), "Torben"));

            this.buildings.Add(new Building(DataIdentifier.modelBuildingCampfire, new Vector3(2, 1, 1), new Vector3(-4, 4, -3)));

            this.mouseSurface = new Plane(Vector3.UnitZ, 0);

            // generate the world
            this.GenerateNewWorld();

            // generate cave models
            this.smallCave  = new SmallCave();
            this.mediumCave = new MediumCave();
            this.largeCave  = new LargeCave();

            this.unitHandler        = new ControlModeHandler.UnitHandler(this);
            this.buildCaveHandler   = new ControlModeHandler.BuildCaveHandler(this);
            this.buildTunnelHandler = new ControlModeHandler.BuildTunnelHandler(this);
            this.clearTunnelHandler = new ControlModeHandler.ClearTunnelHandler(this);
            this.currentModeHandler = null;
        }