示例#1
0
 public Personality(JObject p, WordBank wordBank)
 {
     this.wordBank = wordBank;
     name          = (string)p["Name"];
     like          = p["Like"].Select(x => (string)x).ToArray();
     dontLike      = p["DontLike"].Select(x => (string)x).ToArray();
     haveEnough    = p["HaveEnough"].Select(x => (string)x).ToArray();
     needMore      = p["NeedMore"].Select(x => (string)x).ToArray();
     idleChat      = p["IdleChat"].Select(x => (string)x).ToArray();
     goodTrade     = p["GoodTrade"].Select(x => (string)x).ToArray();
     badTrade      = p["BadTrade"].Select(x => (string)x).ToArray();
 }
示例#2
0
        protected override void Initialize()
        {
            base.Initialize();
            graphicsManager.PreferredBackBufferHeight   = 1080;
            graphicsManager.PreferredBackBufferWidth    = 1920;
            graphicsManager.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;
            graphicsManager.ApplyChanges();
            graphics     = GraphicsDevice;
            windowHeight = GraphicsDevice.Viewport.Bounds.Height;
            windowWidth  = GraphicsDevice.Viewport.Bounds.Width;
            numTilesX    = windowWidth / (float)World.tileSize;
            numTilesY    = windowHeight / (float)World.tileSize;
            maxDist      = (float)Math.Sqrt(numTilesX * numTilesX + numTilesY * numTilesY);

            wordBank = new WordBank();
            CharSprites.Initialize(Content);
            Dialogue.Initialize(Content);
            NPC.Initialize();

            world    = new World(500, 500, Content);
            player   = new Player(new Vector2(world.width / 2, world.height / 2), world, Content);
            worldPos = player.pos;
        }