//private SpriteSheet _spriteSheet; public StarshipMk1(string craftDirectory, DVector2 position, DVector2 velocity, double payloadMass = 0, double propellantMass = 1200000) : base(craftDirectory, position, velocity, payloadMass, propellantMass, null) { StageOffset = new DVector2(0, 0); Fins = new Fin[2]; Fins[0] = new Fin(this, new DVector2(0.0, -12.0), new DVector2(2.8, 10.2), 0.2, "Textures/Spacecrafts/ITS/FwdFlap.png", -1.4); Fins[1] = new Fin(this, new DVector2(0.0, 15.0), new DVector2(4.1, 14.1), 0.2, "Textures/Spacecrafts/ITS/Flap.png", 1.4); Engines = new IEngine[3]; for (int i = 0; i < 3; i++) { double engineOffsetX = (i - 1.0) / 4.0; var offset = new DVector2(engineOffsetX * Width * 0.2, Height * 0.4); Engines[i] = new RaptorSL(i, this, offset); } //_spriteSheet = new SpriteSheet("Textures/Spacecrafts/Its/scaledShip.png", 12, 12); string texturePath = "Its/StarshipMk1.png"; string fullPath = Path.Combine("Textures/Spacecrafts", texturePath); this.Texture = new Bitmap(fullPath); this.payloadMass = payloadMass; }
public override int GetHashCode() { int hash = 1; if (total_ != null) { hash ^= Total.GetHashCode(); } if (zap_ != null) { hash ^= Zap.GetHashCode(); } if (nds_ != null) { hash ^= Nds.GetHashCode(); } if (deb_ != null) { hash ^= Deb.GetHashCode(); } if (fin_ != null) { hash ^= Fin.GetHashCode(); } if (mon_ != null) { hash ^= Mon.GetHashCode(); } if (oth_ != null) { hash ^= Oth.GetHashCode(); } return(hash); }
//private SpriteSheet _spriteSheet; public BFS300(string craftDirectory, DVector2 position, DVector2 velocity, double payloadMass = 0, double propellantMass = 1000000) : base(craftDirectory, position, velocity, payloadMass, propellantMass, null) { StageOffset = new DVector2(0, 0); Fins = new Fin[2]; Fins[0] = new Fin(this, new DVector2(0.2, -22), new DVector2(-2.5, 5), 0, "Textures/Spacecrafts/ITS/Canard.png"); Fins[1] = new Fin(this, new DVector2(2.2, 20.2), new DVector2(5.86, 14.5), -Math.PI / 6); Engines = new IEngine[7]; for (int i = 0; i < 7; i++) { double engineOffsetX = (i - 3.5) / 3.5; var offset = new DVector2(engineOffsetX * Width * 0.2, Height * 0.45); Engines[i] = new RaptorSL300(i, this, offset); } //_spriteSheet = new SpriteSheet("Textures/Spacecrafts/Its/scaledShip.png", 12, 12); string texturePath = "Its/BFS3.png"; string fullPath = Path.Combine("Textures/Spacecrafts", texturePath); this.Texture = new Bitmap(fullPath); this.payloadMass = payloadMass; }
//private SpriteSheet _spriteSheet; public Starship2P2P(string craftDirectory, DVector2 position, DVector2 velocity, double payloadMass = 0, double propellantMass = 1000000) : base(craftDirectory, position, velocity, payloadMass, propellantMass, null) { StageOffset = new DVector2(0, 0); Fins = new Fin[2]; Fins[0] = new Fin(this, new DVector2(-1.2, -18.0), new DVector2(2.5, 5), 0, "Textures/Spacecrafts/ITS/Canard2.png", 1.5); Fins[1] = new Fin(this, new DVector2(2.0, 17.2), new DVector2(5.86, 13.0), -Math.PI / 6, "Textures/Spacecrafts/ITS/Fin.png", 3); Engines = new IEngine[9]; for (int i = 0; i < 9; i++) { double engineOffsetX = (i - 4.0) / 4.0; var offset = new DVector2(engineOffsetX * Width * 0.2, Height * 0.4); Engines[i] = new RaptorSL300(i, this, offset); } //_spriteSheet = new SpriteSheet("Textures/Spacecrafts/Its/scaledShip.png", 12, 12); string texturePath = "Its/Starship.png"; string fullPath = Path.Combine("Textures/Spacecrafts", texturePath); this.Texture = new Bitmap(fullPath); this.payloadMass = payloadMass; }
//private SpriteSheet _spriteSheet; public MiniBFS(string craftDirectory, DVector2 position, DVector2 velocity, double payloadMass = 0, double propellantMass = 100000) : base(craftDirectory, position, velocity, payloadMass, propellantMass, null) { StageOffset = new DVector2(0, 0); Fins = new Fin[2]; Fins[0] = new Fin(this, new DVector2(0.2, -8.95), new DVector2(-1, 2), 0, "Textures/Spacecrafts/ITS/Canard.png"); Fins[1] = new Fin(this, new DVector2(0.8, 8.2), new DVector2(2.38, 5.89), -Math.PI / 6); Engines = new IEngine[1]; for (int i = 0; i < 1; i++) { var offset = new DVector2(0.0, Height * 0.4); Engines[i] = new Merlin1D(i, this, offset); } //_spriteSheet = new SpriteSheet("Textures/Spacecrafts/Its/scaledShip.png", 12, 12); string texturePath = "Its/miniBFS.png"; string fullPath = Path.Combine("Textures/Spacecrafts", texturePath); this.Texture = new Bitmap(fullPath); this.payloadMass = payloadMass; }
// Update is called once per frame void Update() { if (vida <= 0) { Fin.show(); } }
private static WsFrame readHeader(byte[] header) { // FIN Fin fin = (header[0] & 0x80) == 0x80 ? Fin.FINAL : Fin.MORE; // RSV1 Rsv rsv1 = (header[0] & 0x40) == 0x40 ? Rsv.ON : Rsv.OFF; // RSV2 Rsv rsv2 = (header[0] & 0x20) == 0x20 ? Rsv.ON : Rsv.OFF; // RSV3 Rsv rsv3 = (header[0] & 0x10) == 0x10 ? Rsv.ON : Rsv.OFF; // Opcode Opcode opcode = (Opcode)(header[0] & 0x0f); // MASK Mask masked = (header[1] & 0x80) == 0x80 ? Mask.MASK : Mask.UNMASK; // Payload len byte payloadLen = (byte)(header[1] & 0x7f); return(new WsFrame { Fin = fin, Rsv1 = rsv1, Rsv2 = rsv2, Rsv3 = rsv3, Opcode = opcode, Masked = masked, PayloadLen = payloadLen }); }
internal WebSocketFrame( Fin fin, Opcode opcode, PayloadData payloadData, bool compressed = false) { Fin = fin; Rsv1 = IsOpcodeData(opcode) && compressed ? Rsv.On : Rsv.Off; Rsv2 = Rsv.Off; Rsv3 = Rsv.Off; Opcode = opcode; var len = payloadData.Length; if (len < 126) { PayloadLength = (byte)len; ExtendedPayloadLength = Array.Empty <byte>(); } else if (len < 0x010000) { PayloadLength = 126; ExtendedPayloadLength = ((ushort)len).ToByteArray(Endianness.Big); } else { PayloadLength = 127; ExtendedPayloadLength = len.ToByteArray(Endianness.Big); } Mask = Mask.Off; MaskingKey = Array.Empty <byte>(); PayloadData = payloadData; }
// Update is called once per frame void Update() { if (Input.GetButton("Tap")) { iTween.Resume(player); iTween.Resume(electron); iTween.Resume(STC); iTween.Resume(elec2); iTween.Resume(elec3); iTween.Resume(elec4); iTween.Resume(hone); iTween.Resume(htwo); iTween.FadeTo(membInfo, 0f, 0.5f); iTween.FadeTo(mtrcabInfo, 0f, 0.5f); iTween.FadeTo(STCinfo, 0f, 0.5f); iTween.FadeTo(CYMAInfo, 0f, 0.5f); iTween.FadeTo(QUINOLInfo, 0f, 0.5f); iTween.FadeTo(HInfo, 0f, 0.5f); if (count >= 2) { HowLook.CrossFadeAlpha(1.0f, 1.0f, false); } if (count >= 7) { FirstPer.CrossFadeAlpha(1.0f, 1.0f, false); } if (count >= 8) { Fin.CrossFadeAlpha(1.0f, 1.0f, false); } } }
public WsFrame(Fin fin, Opcode opcode, Mask mask, PayloadData payloadData) { if (payloadData.IsNull()) { throw new ArgumentNullException("payloadData"); } if (isControl(opcode) && payloadData.Length > 125) { throw new ArgumentOutOfRangeException("payloadData", "The control frame must have a payload length of 125 bytes or less."); } if (!isFinal(fin) && isControl(opcode)) { throw new ArgumentException("The control frame must not be fragmented."); } Fin = fin; Opcode = opcode; Mask = mask; PayloadData = payloadData; init(); }
public static Fin <Func <B, C> > Apply <A, B, C>(this Func <A, Func <B, C> > fabc, Fin <A> fa) { if (fa.IsFail) { return(Fin <Func <B, C> > .Fail(fa.Error)); } return(fabc(fa.Value)); }
public void ReadTotalSamplesTest(FixtureModel model) { if (model.Process.ContainsKey(FixtureModel.FlacHeaderExtractor)) { Fin <ulong> totalSamples = Flac.ReadTotalSamples(model.ToTargetInformation(this.RealFileSystem).FileStream); Assert.True(totalSamples.IsSucc); ((ulong)totalSamples).Should().Be(model.Record.TotalSamples); } }
public void ReadSampleRateTest(FixtureModel model) { if (model.Process.ContainsKey(FixtureModel.FlacHeaderExtractor)) { Fin <uint> sampleRate = Flac.ReadSampleRate(model.ToTargetInformation(this.RealFileSystem).FileStream); Assert.True(sampleRate.IsSucc); ((uint)sampleRate).Should().Be(model.Record.SampleRateHertz); } }
public void ReadNumChannelsTest(FixtureModel model) { if (model.Process.ContainsKey(FixtureModel.FlacHeaderExtractor)) { Fin <byte> channels = Flac.ReadNumChannels(model.ToTargetInformation(this.RealFileSystem).FileStream); Assert.True(channels.IsSucc); ((byte)channels).Should().Be((byte)model.Record.Channels); } }
public void ReadBitDepthTest(FixtureModel model) { if (model.Process.ContainsKey(FixtureModel.FlacHeaderExtractor)) { Fin <byte> bitDepth = Flac.ReadBitDepth(model.ToTargetInformation(this.RealFileSystem).FileStream); Assert.True(bitDepth.IsSucc); ((byte)bitDepth).Should().Be(model.Record.BitDepth); } }
private async Task <bool> InnerBroadcast(Fin final, Opcode opcode, byte[] data) { var results = Sessions.TakeWhile(session => _state == ServerState.Start) .Select(session => session.Context.WebSocket.InnerSend(final, opcode, data)) .ToArray(); await Task.WhenAll(results).ConfigureAwait(false); return(results.All(x => x.Result)); }
public WsFrame(Fin fin, Opcode opcode, Mask mask, PayloadData payloadData) : this() { Fin = fin; Opcode = opcode; Masked = mask; PayloadData = payloadData; init(); }
public WsFrame(Fin fin, Opcode opcode, Mask mask, PayloadData payloadData) : this() { Fin = fin; Opcode = opcode; Masked = payloadData.Length != 0 ? mask : Mask.UNMASK; PayloadData = payloadData; init(); }
public static Vertex TrueEndVertex(this Fin fin) { if (!(fin.IsReversed ^ fin.Edge.IsReversed)) { return(fin.Edge.EndVertex); } else { return(fin.Edge.StartVertex); } }
public WebSocketFrameHeader(Fin fin, Mask mask, Opcode opcode, ulong payloadLength) { myFin = fin; myMask = mask; Opcode = opcode; myPayloadLength = PayloadLengthByte(payloadLength); ExtPayloadLength = payloadLength; myRsv1 = Rsv.Off; myRsv2 = Rsv.Off; myRsv3 = Rsv.Off; }
public static double TrueEndParam(this Fin fin) { if (!(fin.IsReversed ^ fin.Edge.IsReversed)) { return(fin.Edge.Bounds.Start); } else { return(fin.Edge.Bounds.End); } }
public static Fin <C> Apply <A, B, C>(this Func <A, B, C> fabc, Fin <A> fa, Fin <B> fb) { if (fa.IsFail) { return(Fin <C> .Fail(fa.Error)); } if (fb.IsFail) { return(Fin <C> .Fail(fb.Error)); } return(fabc(fa.Value, fb.Value)); }
// Use this for initialization void Start() { iTween.MoveTo(player, iTween.Hash("path", iTweenPath.GetPath("toShew"), "time", 3, "easetype", iTween.EaseType.easeInOutSine, "oncomplete", "showShewInfo")); iTween.Pause(player); HowLook.CrossFadeAlpha(0.0f, 0.0f, false); FirstPer.CrossFadeAlpha(0.0f, 0.0f, false); Fin.CrossFadeAlpha(0.0f, 0.0f, false); count++; }
public void IsPcmWaveFileTest() { var model = this.data[FixtureModel.SM4BatNormal1]; using var stream = model.ToTargetInformation(this.RealFileSystem).FileStream; Fin <bool> isWave = Wave.IsPcmWaveFile(stream); Assert.True(isWave.IsSucc); ((bool)isWave).Should().Be(model.IsWave); }
public static Fin <B> Apply <A, B>(this Fin <Func <A, B> > fab, Fin <A> fa) { if (fab.IsFail) { return(Fin <B> .Fail(fab.Error)); } if (fa.IsFail) { return(Fin <B> .Fail(fa.Error)); } return(fab.Value(fa.Value)); }
private Task <bool> SendAsync(Fin fin, Opcode opcode, Mask mask, byte[] data, bool compressed) { lock (_forConn) { if (_readyState != WebSocketState.Open) { return(Task.FromResult(false)); } return(WriteBytesAsync( WebSocketFrame.CreateWebSocketFrame(fin, opcode, mask, data, compressed).ToByteArray())); } }
private bool send(Fin fin, Opcode opcode, Mask mask, byte[] data, bool compressed) { lock (_forConn) { if (_readyState != WebSocketState.Open) { return(false); } return(writeBytes( WebSocketFrame.CreateWebSocketFrame(fin, opcode, mask, data, compressed).ToByteArray())); } }
public WsFrame(Fin fin, Opcode opcode, Mask mask, PayloadData payloadData) : this() { Fin = fin; Opcode = opcode; //Masked = payloadData.Length != 0 ? mask : Mask.UNMASK; //client->server always mask whatever having payload //https://github.com/wsky/websocket-sharp/issues/2 Masked = mask; PayloadData = payloadData; init(); }
void IDisposable.Dispose() { VtsGL.wglMakeCurrent(hDC, hRC); Fin?.Invoke(this, new EventArgs()); VtsGL.wglMakeCurrent(IntPtr.Zero, IntPtr.Zero); VtsGL.ReleaseDC(Handle, hDC); if (hRC != IntPtr.Zero) { VtsGL.wglDeleteContext(hRC); hRC = IntPtr.Zero; } }
public List <int> GetListaDeHoras() { List <int> listaHoras = new List <int>(); int total = Math.Abs(Fin.Subtract(Inicio).Hours); DateTime inicio = Inicio; for (int i = 1; i <= total; i++) { listaHoras.Add(int.Parse(inicio.ToString("HH"))); inicio = inicio.AddHours(1); } return(listaHoras); }
private bool send (Fin fin, Opcode opcode, byte[] data, bool compressed) { lock (_forConn) { if (_readyState != WebSocketState.Open) { _logger.Error ("The sending has been interrupted."); return false; } return sendBytes (new WebSocketFrame (fin, opcode, data, compressed, _client).ToArray ()); } }
private WsFrame createFrame(Fin fin, Opcode opcode, PayloadData payloadData) { return _isClient ? new WsFrame(fin, opcode, payloadData) : new WsFrame(fin, opcode, Mask.UNMASK, payloadData); }
private bool send(Fin fin, Opcode opcode, byte[] data, bool compressed) { lock (_forState) { if (_readyState != WebSocketState.Open) { #if COMPAT Log.Error("The sending has been interrupted."); #else "The sending has been interrupted.".Error(); #endif return false; } return SendBytes(new WebSocketFrame(fin, opcode, data, compressed, _client).ToArray()); } }
private static WsFrame createFrame( Fin fin, Opcode opcode, PayloadData payloadData, bool compressed, bool client) { var mask = client ? Mask.MASK : Mask.UNMASK; var frame = new WsFrame (fin, opcode, mask, payloadData, compressed); return frame; }
private bool send(Fin fin, Opcode opcode, byte[] data, bool compressed) { lock (_forConn) { if (_readyState != WebSocketState.Open) { _logger.Error ("Closing the connection has been done."); return false; } return sendBytes ( new WebSocketFrame (fin, opcode, data, compressed, _client).ToByteArray ()); } }
private bool send(Fin fin, Opcode opcode, Mask mask, byte[] data, bool compressed) { lock (_forConn) { if (_readyState != WebSocketState.Open) { return false; } return writeBytes( WebSocketFrame.CreateWebSocketFrame(fin, opcode, mask, data, compressed).ToByteArray()); } }
private bool send(Fin fin, Opcode opcode, byte[] data) { var frame = createFrame(fin, opcode, new PayloadData(data)); return send(frame); }
private bool send(Fin fin, Opcode opcode, byte[] data, bool compressed) { lock (_forState) { if (_readyState != WebSocketState.Open) { _logger.Error ("The state of the connection has been changed."); return false; } var frame = new WebSocketFrame (fin, opcode, data, compressed, _client); return sendBytes (frame.ToArray ()); } }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag ("Player"); objTrans = this.transform; fin = gameCont.GetComponent<Fin> (); }
private bool send(Fin fin, Opcode opcode, byte [] data, bool compressed) { var frame = createFrame (fin, opcode, new PayloadData (data), compressed, _client); return send (frame); }
private static WsFrame createDataFrame( Fin fin, Opcode opcode, PayloadData payloadData, CompressionMethod method, bool compressed, bool client) { var mask = client ? Mask.MASK : Mask.UNMASK; var compress = compressed ? CompressionMethod.NONE : method; var frame = new WsFrame(fin, opcode, mask, payloadData, compress); if (compressed) frame.PerMessageCompressed = true; return frame; }