当前位置: 首页>>代码示例>>C#>>正文


C# DwarfCorp.DwarfTime类代码示例

本文整理汇总了C#中DwarfCorp.DwarfTime的典型用法代码示例。如果您正苦于以下问题:C# DwarfTime类的具体用法?C# DwarfTime怎么用?C# DwarfTime使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DwarfTime类属于DwarfCorp命名空间,在下文中一共展示了DwarfTime类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

        public override void Update(DwarfTime time)
        {
            base.Update(time);
            Animation.Update(time);

            Image = new ImageFrame(Animation.SpriteSheet.GetTexture(), Animation.GetCurrentFrameRect());
        }
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:7,代码来源:IndicatorManager.cs

示例2: Update

        public override void Update(DwarfTime time)
        {
            if (ValueFn != null)
            {
                float value = ValueFn();

                if (value.CompareTo(LastValue) != 0)
                {
                    string operand = "-";
                    Color color = Color.Red;
                    if (value.CompareTo(LastValue) > 0)
                    {
                        operand = "+";
                        color = Color.Green;
                    }

                    IndicatorManager.DrawIndicator(operand + (value - LastValue).ToString(Format) + Postfix,
                        new Vector3(GlobalBounds.Center.X, GlobalBounds.Center.Y, 0), 1.0f, color, Indicator.IndicatorMode.Indicator2D);
                    LastValue = value;

                    Text = Prefix + value.ToString(Format) + Postfix;
                }
            }
            base.Update(time);
        }
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:25,代码来源:Label.cs

示例3: Update

        public virtual void Update(DwarfTime t)
        {
            Time.Update(t);

            if(IsDone())
            {
                OnComplete.Invoke();
            }
        }
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:9,代码来源:MotionAnimation.cs

示例4: Update

 public override void Update(DwarfTime time)
 {
     if (Animation != null)
     {
         Animation.Update(time, Timer.TimerMode.Real);
         Image.Image = Animation.SpriteSheet.GetTexture();
         Image.SourceRect = Animation.GetCurrentFrameRect();
     }
     base.Update(time);
 }
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:10,代码来源:AnimatedImagePanel.cs

示例5: Render

        public override void Render(DwarfTime gameTime, ChunkManager chunks, Camera camera, SpriteBatch spriteBatch, GraphicsDevice graphicsDevice, Effect effect, bool renderingForWater)
        {
            base.Render(gameTime, chunks, camera, spriteBatch, graphicsDevice, effect, renderingForWater);
            effect.Parameters["xTexture"].SetValue(Texture);
            effect.Parameters["xWorld"].SetValue(GlobalTransform);

            foreach(EffectPass pass in effect.CurrentTechnique.Passes)
            {
                pass.Apply();
                Primitive.Render(graphicsDevice);
            }
        }
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:12,代码来源:Box.cs

示例6: Render

        public override void Render(DwarfTime time, SpriteBatch batch)
        {
            if(!IsVisible)
            {
                return;
            }

            if(DrawBounds)
            {
                GUI.Skin.RenderGroup(GlobalBounds, batch);
            }
            Drawer2D.DrawAlignedText(batch, Title, GUI.DefaultFont, Color.Black, Drawer2D.Alignment.Top | Drawer2D.Alignment.Left, GlobalBounds);
            base.Render(time, batch);
        }
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:14,代码来源:GroupBox.cs

示例7: Render

        public override void Render(DwarfTime time, Microsoft.Xna.Framework.Graphics.SpriteBatch batch)
        {
            Drawer2D.FillRect(batch, GlobalBounds, CurrentColor);
            if (BorderWidth > 0)
            {
                Drawer2D.DrawRect(batch, GlobalBounds, BorderColor, BorderWidth);
            }

            if (IsMouseOver)
            {
                Color highlightColor = new Color(255 - CurrentColor.R, 255 - CurrentColor.G, 255 - CurrentColor.B);
                Drawer2D.DrawRect(batch, GlobalBounds, highlightColor, BorderWidth * 2 + 1);
            }

            base.Render(time, batch);
        }
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:16,代码来源:ColorPanel.cs

示例8: HandleTransfers

        public void HandleTransfers(DwarfTime time)
        {
            Voxel atPos = new Voxel();
            while(Transfers.Count > 0)
            {
                Transfer transfer;

                if(!Transfers.TryDequeue(out transfer))
                {
                    break;
                }

                if(transfer.cellFrom.Type == LiquidType.Lava && transfer.cellTo.Type == LiquidType.Water || (transfer.cellFrom.Type == LiquidType.Water && transfer.cellTo.Type == LiquidType.Lava))
                {
                    bool success = Chunks.ChunkData.GetVoxel(transfer.worldLocation, ref atPos);

                    if(success)
                    {
                        Voxel v = atPos;

                        VoxelLibrary.PlaceType(VoxelLibrary.GetVoxelType("Stone"), v);
                        VoxelChunk chunk = Chunks.ChunkData.ChunkMap[v.ChunkID];
                        chunk.Data.Water[v.Index].Type = LiquidType.None;
                        chunk.Data.Water[v.Index].WaterLevel = 0;
                        chunk.ShouldRebuild = true;
                        chunk.ShouldRecalculateLighting = true;
                    }
                }
            }
        }
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:30,代码来源:WaterManager.cs

示例9: Update

        public void Update(DwarfTime time, DateTime currentDate)
        {
            foreach (var mypolitics in FactionPolitics)
            {
                Pair<Faction> pair = mypolitics.Key;
                if (!pair.IsSelfPair() && pair.Contains(PlayState.PlayerFaction))
                {
                    Faction otherFaction = null;

                    otherFaction = pair.First.Equals(PlayState.PlayerFaction) ? pair.Second : pair.First;

                    Race race = otherFaction.Race;
                    Politics relation = mypolitics.Value;

                    if (race.IsIntelligent && race.IsNative && !otherFaction.IsRaceFaction && !relation.HasMet && MathFunctions.RandEvent(1e-2f))
                    {
                        SendTradeEnvoy(otherFaction);
                    }

                    if (race.IsIntelligent && race.IsNative && !otherFaction.IsRaceFaction && relation.GetCurrentRelationship() == Relationship.Hates && MathFunctions.RandEvent(1e-7f))
                    {
                        SendWarParty(otherFaction);
                    }
                }
                mypolitics.Value.UpdateEvents(currentDate);
            }
        }
开发者ID:maroussil,项目名称:dwarfcorp,代码行数:27,代码来源:Diplomacy.cs

示例10: Update

 public override void Update(DwarfTime time)
 {
     if(IsModal && !isClosed && IsVisible)
     {
         GUI.FocusComponent = this;
     }
     else if(GUI.FocusComponent == this)
     {
         GUI.FocusComponent = null;
     }
     base.Update(time);
 }
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:12,代码来源:Dialog.cs

示例11: Render

        public override void Render(DwarfTime time, SpriteBatch batch)
        {
            if(!IsVisible)
            {
                return;
            }

            base.Render(time, batch);
        }
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:9,代码来源:Dialog.cs

示例12: Render

        public override void Render(DwarfTime time)
        {
            if (Voxel != null)
            {

            }
            base.Render(time);
        }
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:8,代码来源:BuildVoxelTask.cs

示例13: Update

        public virtual void Update(DwarfTime gameTime, Timer.TimerMode mode = Timer.TimerMode.Game)
        {
            if(IsPlaying)
            {
                float dt = mode == Timer.TimerMode.Game ? (float)gameTime.ElapsedGameTime.TotalSeconds : (float)gameTime.ElapsedRealTime.TotalSeconds;
                FrameTimer += dt;

                float time = FrameHZ;

                if (Speeds.Count > 0)
                {
                    time = Speeds[Math.Min(CurrentFrame, Speeds.Count - 1)];
                }
                if(FrameTimer * SpeedMultiplier >= 1.0f / time)
                {
                    NextFrame();
                    FrameTimer = 0.0f;
                }
            }
        }
开发者ID:maroussil,项目名称:dwarfcorp,代码行数:20,代码来源:Animation.cs

示例14: Update

        public override void Update(DwarfTime gameTime, ChunkManager chunks, Camera camera)
        {
            if(IsActive)
            {
                if(CurrentAnimation != null)
                {
                    CurrentAnimation.Update(gameTime);
                }
            }

            base.Update(gameTime, chunks, camera);
        }
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:12,代码来源:Sprite.cs

示例15: Render

        public override void Render(DwarfTime time, SpriteBatch batch)
        {
            string text = Text;

            if(WordWrap)
            {
                text = DwarfGUI.WrapLines(Text, LocalBounds, TextFont);
            }

            Drawer2D.DrawAlignedStrokedText(batch, text, TextFont, TextColor, StrokeColor, Alignment, GlobalBounds);
            base.Render(time, batch);
        }
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:12,代码来源:Label.cs


注:本文中的DwarfCorp.DwarfTime类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。