Beispiel #1
0
 public UniformMotionSprite(
     Surface surface, Point2 startLocation, Point2 endLocation,
     float totalTime)
     : this(new StaticAnimation(surface), startLocation, endLocation,
         totalTime)
 {
 }
Beispiel #2
0
 public UniformMotionSprite(
     Surface surface, Point2 startLocation, Vector2F velocity,
     float totalTime)
     : this(new StaticAnimation(surface), startLocation,
         startLocation + (Vector2)(velocity * totalTime),
         totalTime)
 {
 }
Beispiel #3
0
        public CopySurface(
            Surface originalSurface, IEnumerable<Vector2> offsetVectors)
        {
            Contract.Requires(originalSurface != null);
            Contract.Requires(offsetVectors != null);

            _surface = originalSurface;
            _offsetVectors = offsetVectors;
        }
Beispiel #4
0
        public FieldMap(Surface mapImg, IList<Surface> flgImg, Surface convImg)
        {
            Contract.Requires(mapImg != null, "mapImg");
            Contract.Requires(flgImg != null, "flgImg");
            Contract.Requires(convImg != null, "convImg");

            MapImage = mapImg;
            NewtralFlagImage = flgImg;
            ConversationImage = convImg;
        }
 /// <summary>
 /// 指定したサーフェイスが等速に直線移動するアニメーションをマップチップ上に配置する
 /// </summary>
 /// <param name="surface"></param>
 /// <param name="points"></param>
 /// <param name="unitTotalTime"></param>
 /// <param name="changeTime"></param>
 /// <param name="endAnimationEvent"></param>
 public void SetContinuouslyMovingAnimationOnMap(Surface surface, IEnumerable<Point2> points, float unitTotalTime, float changeTime, Action endAnimationEvent)
 {
     var animes = _mapWindow.CreateContinuouslyMovingAnimationOnMap(surface, points, unitTotalTime);
     var count = animes.Count - 1;
     for (int i = 0; i < count; i++)
     {
         animes[i] = new ExtendTimeAnimationSprite(animes[i], changeTime);
     }
     _chipAnimations.Add(new ComplexAnimationSprite(animes), endAnimationEvent);
 }
 /// <summary>
 /// マップチップ上で指定したサーフェイスが指定した地点間で等速直線移動するアニメーション郡を作成します。
 /// </summary>
 /// <param name="surface"></param>
 /// <param name="points"></param>
 /// <param name="unitTotalTime"></param>
 public IList<AnimationSprite> CreateContinuouslyMovingAnimationOnMap(Surface surface, IEnumerable<Point2> points, float unitTotalTime)
 {
     return _mapWindow.CreateContinuouslyMovingAnimationOnMap(surface, points, unitTotalTime);
 }
 public static void DrawSurface(
     this Graphics g, Surface surface, int x, int y)
 {
     surface.Draw(g, x, y);
 }
 public static void DrawSurface(
     this Graphics g, Surface surface, Point2 p)
 {
     surface.Draw(g, p);
 }
Beispiel #9
0
 public Construct(Surface image, LandformInfo landformInfo)
 {
     Image = image;
     Info = landformInfo;
 }
 public UnitImageResources(Surface icon, Surface face, IList<Surface> flag)
 {
     Icon = icon;
     Face = face;
     Flag = flag;
 }
Beispiel #11
0
 public UniformMotionSprite(
     Surface surface, Point2 startLocation, Point2 endLocation,
     float speedOrTotalTime, bool isSpeed)
     : this(new StaticAnimation(surface), startLocation, endLocation,
         isSpeed
             ? (float)(endLocation - startLocation).Length
               / speedOrTotalTime
             : speedOrTotalTime)
 {
 }
Beispiel #12
0
 public void FaceOut(string name, Surface face)
 {
     this.SetSize(SIZE);
     using (var g = Graphics.FromImage(_canvas))
     {
         g.Clear(Color.Navy);
         g.DrawString(name, FONT, Brushes.White, new PointF(3, 0));
         g.DrawSurface(face, new Point(0, SIZE.Height - face.Height));
     };
     this.Invalidate();
 }
Beispiel #13
0
 /// <summary>
 /// マップチップ上で指定したサーフェイスが指定した地点間で等速直線移動するアニメーション郡を作成します。
 /// </summary>
 /// <param name="surface"></param>
 /// <param name="points"></param>
 /// <param name="unitTotalTime"></param>
 public IList<AnimationSprite> CreateContinuouslyMovingAnimationOnMap(
     Surface surface, IEnumerable<Point2> points, float unitTotalTime)
 {
     return points.Zip2Chain()
         .Select(
         t => (AnimationSprite)new UniformMotionSprite(
             surface,
             ChipPoint2PixelCenterPoint(t.Item1),
             ChipPoint2PixelCenterPoint(t.Item2),
             unitTotalTime))
         .ToList();
 }
Beispiel #14
0
        public StaticAnimation(Surface surface)
        {
            Contract.Requires(surface != null);

            _surface = surface;
        }
Beispiel #15
0
 private int GetDrawY(Surface surface, int y)
 {
     switch (VerticalLocationStyle) {
     case VerticalLocationStyle.Top:
         return y;
     case VerticalLocationStyle.Center:
         return (_size.Height - surface.Height) / 2;
     case VerticalLocationStyle.Bottom:
         return _size.Height - surface.Height;
     default:
         throw new ArgumentOutOfRangeException();
     }
 }
Beispiel #16
0
 private int GetDrawX(Surface surface, int x)
 {
     switch (HorizontalLocationStyle) {
     case HorizontalLocationStyle.Left:
         return x;
     case HorizontalLocationStyle.Center:
         return (_size.Width - surface.Width) / 2;
     case HorizontalLocationStyle.Right:
         return _size.Width - surface.Width;
     default:
         throw new ArgumentOutOfRangeException();
     }
 }
Beispiel #17
0
 public Landform(Surface image, LandformInfo landformInfo)
 {
     Image = image;
     Info = landformInfo;
 }
Beispiel #18
0
 // ----- ----- ----- 公開メソッド ----- ----- -----
 public void Conversation(string name, Surface face, Surface convImg)
 {
     _convImg = convImg;
     this.FaceOut(name, face);
     this.Clear();
 }