Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ MassWireOperationInner()

static void Terraria.Wiring.MassWireOperationInner ( Player user,
Point ps,
Point pe,
Vector2 dropPoint,
bool dir,
ref int wireCount,
ref int actuatorCount )
inlinestaticprivate

Definition at line 2884 of file Wiring.cs.

2885 {
2886 Math.Abs(ps.X - pe.X);
2887 Math.Abs(ps.Y - pe.Y);
2888 int num = Math.Sign(pe.X - ps.X);
2889 int num2 = Math.Sign(pe.Y - ps.Y);
2891 Point pt = default(Point);
2892 bool flag = false;
2893 Item.StartCachingType(530);
2894 Item.StartCachingType(849);
2895 bool flag2 = dir;
2896 int num3;
2897 int num4;
2898 int num5;
2899 if (flag2)
2900 {
2901 pt.X = ps.X;
2902 num3 = ps.Y;
2903 num4 = pe.Y;
2904 num5 = num2;
2905 }
2906 else
2907 {
2908 pt.Y = ps.Y;
2909 num3 = ps.X;
2910 num4 = pe.X;
2911 num5 = num;
2912 }
2913 for (int i = num3; i != num4; i += num5)
2914 {
2915 if (flag)
2916 {
2917 break;
2918 }
2919 if (flag2)
2920 {
2921 pt.Y = i;
2922 }
2923 else
2924 {
2925 pt.X = i;
2926 }
2928 if (flag3.HasValue && !flag3.Value)
2929 {
2930 flag = true;
2931 break;
2932 }
2933 }
2934 if (flag2)
2935 {
2936 pt.Y = pe.Y;
2937 num3 = ps.X;
2938 num4 = pe.X;
2939 num5 = num;
2940 }
2941 else
2942 {
2943 pt.X = pe.X;
2944 num3 = ps.Y;
2945 num4 = pe.Y;
2946 num5 = num2;
2947 }
2948 for (int j = num3; j != num4; j += num5)
2949 {
2950 if (flag)
2951 {
2952 break;
2953 }
2954 if (!flag2)
2955 {
2956 pt.Y = j;
2957 }
2958 else
2959 {
2960 pt.X = j;
2961 }
2963 if (flag4.HasValue && !flag4.Value)
2964 {
2965 flag = true;
2966 break;
2967 }
2968 }
2969 if (!flag)
2970 {
2972 }
2974 Item.DropCache(reason, dropPoint, Vector2.Zero, 530);
2975 Item.DropCache(reason, dropPoint, Vector2.Zero, 849);
2976 }
static double Abs(double value)
static int Sign(decimal value)
Definition Math.cs:1202
static ? bool MassWireOperationStep(Player user, Point pt, WiresUI.Settings.MultiToolMode mode, ref int wiresLeftToConsume, ref int actuatorsLeftToConstume)
Definition Wiring.cs:2978

References System.Math.Abs(), Terraria.Item.DropCache(), System.Math.Sign(), Terraria.Item.StartCachingType(), Terraria.GameContent.UI.WiresUI.Settings.ToolMode, and Microsoft.Xna.Framework.Vector2.Zero.

Referenced by Terraria.Wiring.MassWireOperation().