private static void MainMenu() { Console.WriteLine("Welcome, prepare yourself to go on a mission...\n"); Console.WriteLine("First, select your weapon"); Console.WriteLine("***************************************************"); Console.WriteLine("Weapons: "); Console.WriteLine("1. M4"); Console.WriteLine("2. 240L"); int weapon = Convert.ToInt32(Console.ReadLine()); if (weapon == 1) { M4 newM4 = new M4(); newM4.LoadWeapon(); SelectVehicle(); } else if (weapon == 2) { _240L new240 = new _240L(); new240.LoadWeapon(); SelectVehicle(); } else { Console.WriteLine("Invalid Input"); } }
private void M4_Leave(object sender, EventArgs e) { try { conexion.Open(); nombre = (M2.Text); localidad = (M3.Text); iata = Convert.ToInt32(M4.Text); DataGridViewRow FILA = dataGridView1.CurrentRow; id = Convert.ToInt32(FILA.Cells[0].Value); actualizarM(); dataSet.Clear(); dataGridView1.DataSource = dataSet.Tables[0]; Query = "SELECT * FROM aeropuertos;"; NpgsqlDataAdapter add = new NpgsqlDataAdapter(Query, conexion); add.Fill(dataSet); dataGridView1.DataSource = dataSet.Tables[0]; M1.Clear(); M2.Clear(); M3.Clear(); M4.Clear(); } catch (Exception) { MessageBox.Show("Los datos no fueron modificados"); } }
public override Gun spawn(float rarity) { M4 m = new M4(); m.jam_rate = (1f - rarity) / 30; return(m); }
void Awake() { rl = FindObjectOfType <RocketLauncher>(); m4 = FindObjectOfType <M4>(); rb = GetComponent <Rigidbody2D>(); psc = GetComponent <PlayerSoundController>(); animator = GetComponent <Animator>(); PickUpGun(m4); SetToSpawnPoint(); }
public void AddShelvesTest() { var m1 = new M1(2, 50); var groupIds =new int[]{49, 50, 51, 52}; var m2 = new M2(groupIds); var m3 = new M3(49, "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg"); var imgs = new string[] { "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg", "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg", "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg", "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg" }; var m4 = new M4(groupIds, imgs); var m5 = new M5(groupIds, "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg"); var result = ShelfApi.AddShelves("accessToken", m1, m2, m3, m4, m5, "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg", "测试货架"); Console.Write(result); Assert.IsNotNull(result); }
public void AddShelvesTest() { var m1 = new M1(2, 50); var groupIds = new int[] { 49, 50, 51, 52 }; var m2 = new M2(groupIds); var m3 = new M3(49, "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg"); var imgs = new string[] { "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg", "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg", "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg", "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg" }; var m4 = new M4(groupIds, imgs); var m5 = new M5(groupIds, "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg"); var result = ShelfApi.AddShelves("accessToken", m1, m2, m3, m4, m5, "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg", "测试货架"); Console.Write(result); Assert.IsNotNull(result); }
public void Contravariant_Test() { // 逆变: 逆变(Foo<子类> = Foo<父类>) M3 <object> a = null; M3 <string> b = null; M4 <object> c = null; M4 <string> d = null; // b = a; //不支持逆变与协变 d = c; // 支持逆变 IC <object> ia = null; IC <string> ib = null; ID <object> ic = null; ID <string> id = null; //ib = ia; id = ic; IEnumerable <object> ie = null; IEnumerable <string> ig = null; //ig = ie; // 不支持逆变 ie = ig; // 支持协变 IEnumerable <object> data = new List <Product> { new Product { SysNo = 1, Price = 20m } }; IEnumerable <Product> source = null; //data = source; source = (IEnumerable <Product>)data; ie = source; }
private Mdlx(Stream stream) { var type = ReadMdlxType(stream); stream.Position = 0; switch (type) { case Map: MapModel = ReadAsMap(new SubStream(stream, ReservedArea, stream.Length - ReservedArea)); break; case Entity: SubModels = ReadAsModel(stream).ToList(); break; } }
// Start is called before the first frame update void Start() { StartCoroutine(Utils.SetVRDevice("OpenVR", true)); MC1 = M1.GetComponent <MasterController>(); MC2 = M2.GetComponent <MasterController>(); MC3 = M3.GetComponent <MasterController>(); MC4 = M4.GetComponent <MasterController>(); MC5 = M5.GetComponent <MasterController>(); MC6 = M6.GetComponent <MasterController>(); MC7 = M7.GetComponent <MasterController>(); MC8 = M8.GetComponent <MasterController>(); loadLevel(); currentPoseIndex = 0; }
public Aeropuertos() { InitializeComponent(); string servidor = "localhost"; int puerto = 5432; string usuario = "postgres"; int clave = 123; string baseDatos = "proyectgb"; cadenaConexion = "Server=" + servidor + "; " + "Port=" + puerto + "; " + "User Id=" + usuario + "; " + "Password="******"; " + "Database=" + baseDatos; conexion = new NpgsqlConnection(cadenaConexion); Console.WriteLine(cadenaConexion); try { conexion.Open(); } catch (Exception E) { } Query = "SELECT * FROM aeropuertos; "; NpgsqlDataAdapter add = new NpgsqlDataAdapter(Query, conexion); add.Fill(dataSet); dataGridView1.DataSource = dataSet.Tables[0]; dataGridView2.DataSource = dataSet.Tables[0]; dataGridView3.DataSource = dataSet.Tables[0]; A1.Clear(); A2.Clear(); A3.Clear(); A4.Clear(); M1.Clear(); M2.Clear(); M3.Clear(); M4.Clear(); conexion.Close(); Insertar(id, nombre, localidad, iata); }
public static void Main(string[] args) { Auto auto = new Auto(3000, "Rojo"); BMW bmw = new BMW("A4", 2000, "negro"); Audi audi = new Audi("M3", 2500, "gris"); M4 m4 = new M4("M4", 2500, "verde"); auto.MostrarDetalles(); auto.Reparar(); auto.SetearAutoInfo(23400, "Oscar Osambela"); auto.LeerAutoInfo(); bmw.MostrarDetalles(); bmw.Reparar(); bmw.SetearAutoInfo(0000123, "Oscar Osambela"); bmw.LeerAutoInfo(); audi.MostrarDetalles(); audi.Reparar(); audi.SetearAutoInfo(567328, "Francisco"); audi.LeerAutoInfo(); m4.MostrarDetalles(); m4.Reparar(); m4.SetearAutoInfo(34001, "Vernita"); Console.WriteLine("========================="); var autos = new List <Auto> { new Audi("M3", 2500, "gris"), new BMW("A4", 2000, "negro"), new M4("M4", 2500, "verde") }; foreach (var a in autos) { a.MostrarDetalles(); a.Reparar(); } }
IEnumerator Merit() { yield return(new WaitForSeconds(Pause * 2)); M1.SetActive(true); yield return(new WaitForSeconds(Pause)); M2.SetActive(true); yield return(new WaitForSeconds(Pause)); M3.SetActive(true); yield return(new WaitForSeconds(Pause)); M4.SetActive(true); yield return(new WaitForSeconds(Pause)); M5.SetActive(true); yield return(new WaitForSeconds(Pause * 2)); Victory.SetActive(true); yield return(new WaitForSeconds(Pause * 2)); Application.LoadLevel("Credits"); }
private Mdlx(M4 mapModel) { this.MapModel = mapModel; }
public void M4(M4 input) { }
private static void WriteAsMap(Stream stream, M4 mapModel) { var mapHeader = new SubModelMapHeader { Type = Map, DmaChainMapCount = mapModel.VifPackets.Count, Unk04 = mapModel.unk04, Unk08 = mapModel.unk08, NextOffset = mapModel.nextOffset, va4 = mapModel.va4, Count1 = mapModel.count1, // in a form, ignored by the game engine }; BinaryMapping.WriteObject(stream, mapHeader); var dmaChainMapDescriptorOffset = (int)stream.Position; stream.Position += mapModel.VifPackets.Count * 0x10; mapHeader.Offset1 = (int)stream.Position; stream.Position += mapModel.alb2.Count * 4; var alb2Offsets = new List <int>(); foreach (var alb2 in mapModel.alb2) { alb2Offsets.Add((int)stream.Position); WriteAlb2(stream, alb2); } var endAlb2Offset = Helpers.Align((int)stream.Position, 4); stream.Position = mapHeader.Offset1; foreach (var alb2Offset in alb2Offsets) { stream.Write(alb2Offset); } stream.Position = endAlb2Offset; mapHeader.Offset2 = endAlb2Offset; stream.Write(endAlb2Offset + 4 + mapModel.unknownTable.Length * 4); stream.Write(mapModel.unknownTable); WriteAlb2(stream, mapModel.alb1t2); stream.AlignPosition(0x10); var dmaChainVifOffsets = new List <int>(); foreach (var dmaChainMap in mapModel.VifPackets) { var vifPacketIndex = 0; dmaChainVifOffsets.Add((int)stream.Position); foreach (var packetCount in dmaChainMap.DmaPerVif) { BinaryMapping.WriteObject(stream, new DmaTag { Qwc = packetCount, Address = 0, TagId = packetCount > 0 ? 1 : 6, Irq = false, }); var packetLength = packetCount * 0x10 + 8; stream.Write(dmaChainMap.VifPacket, vifPacketIndex, packetLength); vifPacketIndex += packetLength; } } stream.AlignPosition(0x80); stream.SetLength(stream.Position); stream.Position = dmaChainMapDescriptorOffset; for (var i = 0; i < mapModel.VifPackets.Count; i++) { var dmaChainMap = mapModel.VifPackets[i]; BinaryMapping.WriteObject(stream, new DmaChainMap { VifOffset = dmaChainVifOffsets[i], TextureIndex = dmaChainMap.TextureId, Unk08 = dmaChainMap.Unk08, Unk0c = dmaChainMap.Unk0c }); } stream.Position = 0; BinaryMapping.WriteObject(stream, mapHeader); }
public static Mdlx CreateFromMapModel(M4 mapModel) => new Mdlx(mapModel);
public SyncMethod NewSyncMethod <T, U, V, W>(M4 <T, U, V, W> @delegate) { return(new SyncMethod(this, @delegate)); }
public Task HandleMessageAsync(M4 message, CancellationToken cancellationToken) => throw new System.NotImplementedException();
public void Continue <T, U, V, W>(M4 <T, U, V, W> m) { PrivateContinue(m); }
public void Pool <T, U, V, W>(M4 <T, U, V, W> m) { PrivatePool(m); }
public void SyncContext <T, U, V, W>(M4 <T, U, V, W> m) { PrivateSyncContext(m); }
public void Do <T, U, V>(M4 <T, U, V> m) { DoAny(m); }
public void SyncContext <T, U, V, W>(M4 <T, U, V, W> m) { SyncContext(m); }
public void Do <T, U, V, W, X>(M4 <T, U, V, W, X> m) { DoAny(m); }
public void Spawn <T, U, V, W>(M4 <T, U, V, W> m) { PrivateSpawn(m); }
public void Do <T, U, V, W, X, Y, Z>(M4 <T, U, V, W, X, Y, Z> m) { DoAny(m); }
public void Do <T, U, V, W>(M4 <T, U, V, W> m) { PrivateDo(m); }
private static void WriteAsMap(Stream stream, M4 mapModel) { var mapHeader = new SubModelMapHeader { Type = Map, DmaChainMapCount = mapModel.VifPackets.Count, Unk04 = mapModel.unk04, Unk08 = mapModel.unk08, NextOffset = mapModel.nextOffset, va4 = mapModel.va4, CountVifPacketRenderingGroup = Convert.ToInt16(mapModel.vifPacketRenderingGroup.Count), }; BinaryMapping.WriteObject(stream, mapHeader); var dmaChainMapDescriptorOffset = (int)stream.Position; stream.Position += mapModel.VifPackets.Count * 0x10; mapHeader.OffsetVifPacketRenderingGroup = (int)stream.Position; stream.Position += mapModel.vifPacketRenderingGroup.Count * 4; var groupOffsets = new List <int>(); foreach (var group in mapModel.vifPacketRenderingGroup) { groupOffsets.Add((int)stream.Position); WriteUInt16List(stream, group); } // capture remapTable offset here var remapTableOffsetToOffset = Helpers.Align((int)stream.Position, 4); // seek back and fill offsets stream.Position = mapHeader.OffsetVifPacketRenderingGroup; foreach (var offset in groupOffsets) { stream.Write(offset); } // write remapTable here stream.Position = remapTableOffsetToOffset; mapHeader.OffsetToOffsetDmaChainIndexRemapTable = remapTableOffsetToOffset; var remapTableOffset = remapTableOffsetToOffset + 4; stream.Write(remapTableOffset); WriteUInt16List(stream, mapModel.DmaChainIndexRemapTable); stream.AlignPosition(0x10); var dmaChainVifOffsets = new List <int>(); foreach (var dmaChainMap in mapModel.VifPackets) { var vifPacketIndex = 0; dmaChainVifOffsets.Add((int)stream.Position); foreach (var packetCount in dmaChainMap.DmaPerVif) { BinaryMapping.WriteObject(stream, new DmaTag { Qwc = packetCount, Address = 0, TagId = packetCount > 0 ? 1 : 6, Irq = false, }); var packetLength = packetCount * 0x10 + 8; stream.Write(dmaChainMap.VifPacket, vifPacketIndex, packetLength); vifPacketIndex += packetLength; } } stream.AlignPosition(0x80); stream.SetLength(stream.Position); stream.Position = dmaChainMapDescriptorOffset; for (var i = 0; i < mapModel.VifPackets.Count; i++) { var dmaChainMap = mapModel.VifPackets[i]; BinaryMapping.WriteObject(stream, new DmaChainMap { VifOffset = dmaChainVifOffsets[i], TextureIndex = dmaChainMap.TextureId, Unk08 = dmaChainMap.Unk08, Unk0a = dmaChainMap.IsTransparentFlag, Unk0c = dmaChainMap.Unk0c }); } stream.Position = 0; BinaryMapping.WriteObject(stream, mapHeader); }