本文整理汇总了C#中Offset类的典型用法代码示例。如果您正苦于以下问题:C# Offset类的具体用法?C# Offset怎么用?C# Offset使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Offset类属于命名空间,在下文中一共展示了Offset类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: FigureBase
private FigureBase(PositionsCollection positions, byte positionNumber, Offset placement)
{
_positions = positions;
_positionNumber = positionNumber;
_sprite = _positions.GetPositionByNumber(positionNumber);
_placement = placement;
}
开发者ID:MarkiyanMatsekh,项目名称:MultiplayerTetris,代码行数:7,代码来源:FigureBase.cs
示例2: CreateSecondTableInA
public static Offset<SecondTableInA> CreateSecondTableInA(FlatBufferBuilder builder,
Offset<NamespaceC.TableInC> refer_to_cOffset = default(Offset<NamespaceC.TableInC>))
{
builder.StartObject(1);
SecondTableInA.AddReferToC(builder, refer_to_cOffset);
return SecondTableInA.EndSecondTableInA(builder);
}
开发者ID:CadeLaRen,项目名称:flatbuffers,代码行数:7,代码来源:SecondTableInA.cs
示例3: PostProcessWithCut
public Offset PostProcessWithCut(Offset cutOffset, out int cutIndex, out Offset botOffset)
{
Offset offset = PostProcess1();
cutIndex = FindCutPoint(cutOffset);
botOffset = _members[cutIndex - 1].BotOffset;
return offset;
}
开发者ID:LibreCrops,项目名称:cdef,代码行数:7,代码来源:AnonymousStruct.cs
示例4: PostProcessWithCut
public Offset PostProcessWithCut(out AnonymousStruct lastStruct, out int beginIndex)
{
// just to satisfy c# compiler (can't you be smarter?)
beginIndex = -1;
AnonymousStruct last = (AnonymousStruct)_members.Last();
Offset maxBotOffset = Offset.Zero;
foreach (AnonymousStruct struc in _members)
{
Offset offset;
if (object.ReferenceEquals(last, struc))
{
Offset offsetBeforeCut;
offset = struc.PostProcessWithCut(
maxBotOffset,
out beginIndex,
out offsetBeforeCut
);
_botOffset = Offset.Max(maxBotOffset, offsetBeforeCut);
}
else
{
offset = struc.PostProcessWithoutCut();
}
maxBotOffset = Offset.Max(offset, maxBotOffset);
}
lastStruct = last;
return maxBotOffset;
}
开发者ID:LibreCrops,项目名称:cdef,代码行数:30,代码来源:AnonymousUnion.cs
示例5: ZoneRuleSet
internal ZoneRuleSet(List<ZoneRecurrence> rules, Offset standardOffset, int upperYear, ZoneYearOffset upperYearOffset)
{
this.rules = rules;
this.StandardOffset = standardOffset;
this.upperYear = upperYear;
this.upperYearOffset = upperYearOffset;
}
开发者ID:nicklbailey,项目名称:nodatime,代码行数:7,代码来源:ZoneRuleSet.cs
示例6: Render
public void Render(ISprite sprite, Offset offset)
{
if (sprite == null)
throw new ArgumentNullException("sprite");
if (offset == null)
throw new ArgumentNullException("offset");
var consoleColorBackup = Console.BackgroundColor;
Console.Clear(); // yeaks!
var width = sprite.Size.Width;
var height = sprite.Size.Height;
for (int i = widthBorderOffset; i < width + widthBorderOffset; i++)
{
Console.SetCursorPosition(i, 0);
Console.Write('-');
Console.SetCursorPosition(i, height + heightBorderOffset);
Console.Write('-');
}
for (int j = heightBorderOffset; j < height + heightBorderOffset; j++)
{
Console.SetCursorPosition(0, j);
Console.Write('|');
Console.SetCursorPosition(width + widthBorderOffset, j);
Console.Write('|');
}
Console.SetCursorPosition(0, 0);
Console.Write('/');
Console.SetCursorPosition(width + widthBorderOffset, 0);
Console.Write('\\');
Console.SetCursorPosition(0, height + heightBorderOffset);
Console.Write('\\');
Console.SetCursorPosition(width + widthBorderOffset, height + heightBorderOffset);
Console.Write('/');
var consoleBounds = new { Width = Console.WindowWidth, Height = Console.WindowHeight };
for (var i = 0; i < sprite.Size.Width; i++)
{
for (var j = 0; j < sprite.Size.Height; j++)
{
var x = offset.Left + i + widthBorderOffset;
var y = offset.Top + j + heightBorderOffset;
var brushBackground = sprite[i, j];
if (!((x >= 0) && (x < consoleBounds.Width) && (y >= 0)) || brushBackground == Color.Transparent)
{
continue;
}
Console.SetCursorPosition(x, y);
Console.BackgroundColor = brushBackground.ToConsoleColor();
Console.Write(_brushSymbol);
}
}
Console.BackgroundColor = consoleColorBackup;
}
开发者ID:MarkiyanMatsekh,项目名称:MultiplayerTetris,代码行数:60,代码来源:ConsoleRenderer.cs
示例7: CreateInputCommand
public static Offset<InputCommand> CreateInputCommand(FlatBufferBuilder builder,
Offset<CommandFrame> frame = default(Offset<CommandFrame>))
{
builder.StartObject(1);
InputCommand.AddFrame(builder, frame);
return InputCommand.EndInputCommand(builder);
}
开发者ID:wuyuntao,项目名称:DeterministicLockstepNetworking,代码行数:7,代码来源:InputCommand.cs
示例8: ToInt32FromBigEndian
public static int ToInt32FromBigEndian(byte[] input, int index, Offset offset)
{
if (input.Length == 0)
return 0;
if (index >= input.Length)
throw new ArgumentOutOfRangeException("index");
// If we're offset from the MinValue, calculate the lowest value possible with the given amount of input bytes
int offsetValue = offset == Offset.Zero ? 0 : (-1 * (1 << Math.Min(input.Length - index, sizeof(int)) * 8 - 1));
switch (input.Length - index)
{
case 1:
return offsetValue + input[index];
case 2:
return offsetValue + (input[index] << 8 | input[index + 1]);
case 3:
return offsetValue + (input[index] << 16 | input[index + 1] << 8 | input[index + 2]);
default:
return offsetValue + (input[index] << 24 | input[index + 1] << 16 | input[index + 2] << 8 | input[index + 3]);
}
}
开发者ID:Robin--,项目名称:OrcaMDF,代码行数:26,代码来源:SqlBitConverter.cs
示例9: Timezone
public Timezone(string name, string abbreviation, Offset? offset, bool tokenizeOnAbbreviation = true)
{
Name = name;
Abbreviation = abbreviation;
_offset = offset;
TimezoneId = null;
TokenizeOnAbbreviation = tokenizeOnAbbreviation;
}
开发者ID:darkosancanin,项目名称:naturaldatetime_web,代码行数:8,代码来源:Timezones.cs
示例10: SymbolStyle
public SymbolStyle()
{
SymbolOffset = new Offset();
SymbolScale = 1f;
Opacity = 1f;
Width = 32;
Height = 32;
}
开发者ID:HackatonArGP,项目名称:Guardianes,代码行数:8,代码来源:SymbolStyle.cs
示例11: SingleTransitionDateTimeZone
/// <summary>
/// Creates a zone with a single transition between two offsets.
/// </summary>
/// <param name="transitionPoint">The transition point as an <see cref="Instant"/>.</param>
/// <param name="offsetBefore">The offset of local time from UTC before the transition.</param>
/// <param name="offsetAfter">The offset of local time from UTC before the transition.</param>
/// <param name="id">ID for the newly created time zone.</param>
public SingleTransitionDateTimeZone(Instant transitionPoint, Offset offsetBefore, Offset offsetAfter, string id)
: base(id, false, Offset.Min(offsetBefore, offsetAfter), Offset.Max(offsetBefore, offsetAfter))
{
EarlyInterval = new ZoneInterval(id + "-Early", null, transitionPoint,
offsetBefore, Offset.Zero);
LateInterval = new ZoneInterval(id + "-Late", transitionPoint, null,
offsetAfter, Offset.Zero);
}
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:15,代码来源:SingleTransitionDateTimeZone.cs
示例12: ZoneTransition
/// <summary>
/// Initializes a new instance of the <see cref="ZoneTransition"/> class.
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="instant">The instant that this transistion occurs at.</param>
/// <param name="name">The name for the time at this transition e.g. PDT or PST.</param>
/// <param name="standardOffset">The standard offset at this transition.</param>
/// <param name="savings">The actual offset at this transition.</param>
internal ZoneTransition(Instant instant, String name, Offset standardOffset, Offset savings)
{
Preconditions.CheckNotNull(name, "name");
this.Instant = instant;
this.Name = name;
this.StandardOffset = standardOffset;
this.Savings = savings;
}
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:17,代码来源:ZoneTransition.cs
示例13: Equals
public bool Equals(Offset offset)
{
// ReSharper disable once CompareOfFloatsByEqualityOperator
if (X != offset.X) return false;
// ReSharper disable once CompareOfFloatsByEqualityOperator
if (Y != offset.Y) return false;
return true;
}
开发者ID:pauldendulk,项目名称:Mapsui,代码行数:8,代码来源:Offset.cs
示例14: CreateTableInC
public static Offset<NamespaceC.TableInC> CreateTableInC(FlatBufferBuilder builder,
Offset<NamespaceA.TableInFirstNS> refer_to_a1Offset = default(Offset<NamespaceA.TableInFirstNS>),
Offset<SecondTableInA> refer_to_a2Offset = default(Offset<SecondTableInA>)) {
builder.StartObject(2);
TableInC.AddReferToA2(builder, refer_to_a2Offset);
TableInC.AddReferToA1(builder, refer_to_a1Offset);
return TableInC.EndTableInC(builder);
}
开发者ID:neuronesb,项目名称:flatbuffers,代码行数:8,代码来源:TableInC.cs
示例15: FigureO
public FigureO(Offset placement, Color color)
: base(placement, new PositionsCollection(color, new List<int[,]>
{ _layout,
_layout,
_layout,
_layout }))
{
}
开发者ID:MarkiyanMatsekh,项目名称:MultiplayerTetris,代码行数:8,代码来源:FigureO.cs
示例16: MakeId
/// <summary>
/// Makes the id for this time zone. The format is "UTC+/-Offset".
/// </summary>
/// <param name="offset">The offset.</param>
/// <returns>The generated id string.</returns>
private static string MakeId(Offset offset)
{
if (offset == Offset.Zero)
{
return UtcId;
}
return UtcId + OffsetPattern.GeneralInvariantPattern.Format(offset);
}
开发者ID:ivandrofly,项目名称:nodatime,代码行数:13,代码来源:FixedDateTimeZone.cs
示例17: SingleTransitionZone
/// <summary>
/// Creates a zone with a single transition between two offsets.
/// </summary>
/// <param name="transitionPoint">The transition point as an <see cref="Instant"/>.</param>
/// <param name="offsetBefore">The offset of local time from UTC before the transition.</param>
/// <param name="offsetAfter">The offset of local time from UTC before the transition.</param>
public SingleTransitionZone(Instant transitionPoint, Offset offsetBefore, Offset offsetAfter)
: base("Single", false, Offset.Min(offsetBefore, offsetAfter), Offset.Max(offsetBefore, offsetAfter))
{
earlyInterval = new ZoneInterval("Single-Early", Instant.MinValue, transitionPoint,
offsetBefore, Offset.Zero);
lateInterval = new ZoneInterval("Single-Late", transitionPoint, Instant.MaxValue,
offsetAfter, Offset.Zero);
}
开发者ID:manirana007,项目名称:NodaTime,代码行数:14,代码来源:SingleTransitionZone.cs
示例18: OffsetModulo
private static PointDTO OffsetModulo(PointDTO p, Offset offset, SizeDTO boardSize)
{
return new PointDTO
{
X = (p.X + offset.DX + boardSize.Width)%boardSize.Width,
Y = (p.Y + offset.DY + boardSize.Height)%boardSize.Height
};
}
开发者ID:kszabelski,项目名称:SnakeWars-CSharp,代码行数:8,代码来源:Move.cs
示例19: MakeId
/// <summary>
/// Makes the id for this time zone. The format is "UTC+/-Offset".
/// </summary>
/// <param name="offset">The offset.</param>
/// <returns>The generated id string.</returns>
private static string MakeId(Offset offset)
{
if (offset == Offset.Zero)
{
return UtcId;
}
return string.Format(CultureInfo.InvariantCulture,
"{0}{1}", UtcId, OffsetPattern.GeneralInvariantPattern.Format(offset));
}
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:14,代码来源:FixedDateTimeZone.cs
示例20: GetUpperLimit
/// <summary>
/// Gets the inclusive upper limit of time that this rule set applies to.
/// </summary>
/// <param name="savings">The daylight savings value during the final zone interval.</param>
/// <returns>The <see cref="LocalInstant"/> of the upper limit for this rule set.</returns>
internal Instant GetUpperLimit(Offset savings)
{
if (IsInfinite)
{
return Instant.AfterMaxValue;
}
var localInstant = upperYearOffset.GetOccurrenceForYear(upperYear);
var offset = upperYearOffset.GetRuleOffset(StandardOffset, savings);
return localInstant.SafeMinus(offset);
}
开发者ID:nicklbailey,项目名称:nodatime,代码行数:15,代码来源:ZoneRuleSet.cs
注:本文中的Offset类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论