コード例 #1
0
ファイル: TrainDat.cs プロジェクト: AlteredCarrot71/OpenBVExp
 internal Handle()
 {
     this.HandleType            = HandleTypes.Separate;
     this.PowerNotches          = 8;
     this.BrakeNotches          = 8;
     this.PowerNotchReduceSteps = 0;
 }
コード例 #2
0
 public BezierHandle(PointF p, HandleTypes type)
 {
     this.mCurrentPoint = p;
     this.mHandleType = type;
     Init();
     if(type == HandleTypes.Single)
     {
         this.Tangent1.Enabled = true;
         this.Tangent2.Enabled = false;
     }
 }
コード例 #3
0
 public BezierHandle(float x, float y, HandleTypes type)
 {
     this.mCurrentPoint = new PointF(x,y);
     this.mHandleType = type;
     Init();
     if(type == HandleTypes.Single)
     {
         this.Tangent1.Enabled = true;
         this.Tangent2.Enabled = false;
     }
 }
コード例 #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="p">a point</param>
 /// <param name="type">the handle type</param>
 public BezierHandle(PointF p, HandleTypes type)
 {
     this.CurrentPoint = p;
     this.mHandleType  = type;
     Init();
     if (type == HandleTypes.Single)
     {
         this.Tangent1.Enabled = true;
         this.Tangent2.Enabled = false;
     }
 }
コード例 #5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="x">the x-coordinate of the handle</param>
 /// <param name="y">the y-coordinate of the handle</param>
 /// <param name="type">the handle type</param>
 public BezierHandle(float x, float y, HandleTypes type)
 {
     this.CurrentPoint = new PointF(x, y);
     this.mHandleType  = type;
     Init();
     if (type == HandleTypes.Single)
     {
         this.Tangent1.Enabled = true;
         this.Tangent2.Enabled = false;
     }
 }
コード例 #6
0
 internal Handle()
 {
     HandleType            = HandleTypes.Separate;
     PowerNotches          = 8;
     BrakeNotches          = 8;
     PowerNotchReduceSteps = 0;
     LocoBrakeNotches      = 0;
     HandleBehaviour       = EbHandleBehaviour.NoAction;
     LocoBrake             = LocoBrakeType.Combined;
     DriverPowerNotches    = 8;
     DriverBrakeNotches    = 8;
 }
コード例 #7
0
ファイル: TrainDat.cs プロジェクト: noidelsucre/OpenBVE
			internal Handle() {
				this.HandleType = HandleTypes.Separate;
				this.PowerNotches = 8;
				this.BrakeNotches = 8;
				this.PowerNotchReduceSteps = 0;
			}
コード例 #8
0
ファイル: Program.cs プロジェクト: useada/ARPG-Game
        static void Main(string[] args)
        {
            var root     = string.Empty;
            var file     = string.Empty;
            var fileSave = string.Empty;
            var type     = string.Empty;

            foreach (var i in args)
            {
                if (i.StartsWith("dir:", StringComparison.CurrentCultureIgnoreCase))
                {
                    root = i.Replace("dir:", "");
                }

                if (i.StartsWith("file:", StringComparison.CurrentCultureIgnoreCase))
                {
                    file = i.Replace("file:", "");
                }

                if (i.StartsWith("saveto:", StringComparison.CurrentCultureIgnoreCase))
                {
                    fileSave = i.Replace("saveto:", "");
                }
                if (i.StartsWith("type:", StringComparison.CurrentCultureIgnoreCase))
                {
                    type = i.Replace("type:", "");
                }
            }

            Console.WriteLine(string.Format("dir:{0} file:{1} saveto:{2}", root, file, fileSave));
            switch (type)
            {
            case "handle":
            {
                var messages = new HashSet <string>();
                var files    = file.Split(',');
                foreach (var i in files)
                {
                    var proto = new ParserProto(root);
                    proto.CompieFile(i);
                    foreach (var s in proto.Structs)
                    {
                        if (messages.Contains(s.Name))
                        {
                            continue;
                        }
                        messages.Add(s.Name);
                    }
                }

                //var temp = @"   []"
                var sb = new StringBuilder();
                foreach (var i in messages)
                {
                    sb.AppendLine(@"    [MessageHandle(typeof(" + i + ")," + i.GetHashCode() + ")]");
                }

                var result = HandleTypes.Replace("[HANDLETYPES]", sb.ToString());
                File.WriteAllText(Path.Combine(root, fileSave), result);
            }
            break;

            default:
            {
                //Console.WriteLine(string.Format("dir:{0} file:{1} saveto:{2}", root, file, fileSave));
                var files = file.Split(',');
                foreach (var i in files)
                {
                    var proto = new ParserProto(root);
                    proto.CompieFile(i);
                    proto.TOcsFile(fileSave);
                }
            }
            break;
            }
        }