public House(int bedRoom, int bathRoom, float area, Decoration decor, Village villages) { this.bedRoom = bedRoom; this.bathRoom = bathRoom; this.area = area; this.decor = decor; this.villages = villages; }
/// <summary> /// Replaces a Decoration /// </summary> public void updateDeco(DECO_CATEGORY category, int index, Decoration newDeco) { List <Decoration> l = getDecoList(category); Decoration oldDeco = l[index]; l[index] = newDeco; historyStack.Add(new HNodeDecoUpdated(this, oldDeco, newDeco, index, category)); }
public LargeSlot(Decoration decoration = null) { Type = SlotType.Large; if (decoration != null) { Decoration = decoration; } }
public ActionResult DeleteConfirmed(int id) { Decoration decoration = db.Decorations.Find(id); db.Decorations.Remove(decoration); db.SaveChanges(); return(RedirectToAction("Index")); }
public SmallSlot(Decoration decoration = null) { Type = SlotType.Small; if (decoration != null) { Decoration = decoration; } }
public HNodeDecoUpdated(LevelSession parent, Decoration oldDeco, Decoration newDeco, int index, DECO_CATEGORY list) : base(parent) { this.oldDeco = oldDeco; this.newDeco = newDeco; this.index = index; this.list = list; }
private void LoadDecoration() { foreach (string s in new string[] { "Crate", "Crystal", "IceBox", "Igloo", "Sign_0", "Sign_1", "SnowMan", "Stone", "Tree_0", "Tree_1" }) { Decoration decoration = new Decoration(new StillImageAnimationComponent("Winter\\Object\\" + s)); AddGameObjectToToolbox(decoration); } }
public MediumSlot(Decoration decoration = null) { Type = SlotType.Medium; if (decoration != null) { Decoration = decoration; } }
public void AddDecoration() { if (!decoration.isCreated) { int index = Random.Range(0, gridModel.decoration.Length - 1); Debug.Log("decoration Length " + gridModel.decoration.Length); decoration = new Decoration(prefab, gridModel.decoration[index], i, j, gameObject.transform); } }
public _DecorationClipper( TextDirection?textDirection = null, Decoration decoration = null ) { D.assert(decoration != null); this.textDirection = textDirection ?? TextDirection.ltr; this.decoration = decoration; }
public override Widget build(BuildContext context) { D.assert(Overlay.of(context, debugRequiredFor: widget) != null); ThemeData theme = Theme.of(context); TooltipThemeData tooltipTheme = TooltipTheme.of(context); TextStyle defaultTextStyle; BoxDecoration defaultDecoration; if (theme.brightness == Brightness.dark) { defaultTextStyle = theme.textTheme.bodyText2.copyWith( color: Colors.black ); defaultDecoration = new BoxDecoration( color: Colors.white.withOpacity(0.9f), borderRadius: BorderRadius.all(Radius.circular(4)) ); } else { defaultTextStyle = theme.textTheme.bodyText2.copyWith( color: Colors.white ); defaultDecoration = new BoxDecoration( color: Colors.grey[700].withOpacity(0.9f), borderRadius: BorderRadius.all(Radius.circular(4)) ); } height = widget.height ?? tooltipTheme?.height ?? _defaultTooltipHeight; padding = widget.padding ?? tooltipTheme?.padding ?? _defaultPadding; margin = widget.margin ?? tooltipTheme?.margin ?? _defaultMargin; verticalOffset = widget.verticalOffset ?? tooltipTheme?.verticalOffset ?? _defaultVerticalOffset; preferBelow = widget.preferBelow ?? tooltipTheme?.preferBelow ?? _defaultPreferBelow; excludeFromSemantics = widget.excludeFromSemantics ?? tooltipTheme?.excludeFromSemantics ?? _defaultExcludeFromSemantics; decoration = widget.decoration ?? tooltipTheme?.decoration ?? defaultDecoration; textStyle = widget.textStyle ?? tooltipTheme?.textStyle ?? defaultTextStyle; waitDuration = widget.waitDuration ?? tooltipTheme?.waitDuration ?? _defaultWaitDuration; showDuration = widget.showDuration ?? tooltipTheme?.showDuration ?? _defaultShowDuration; Widget result = new GestureDetector( behavior: HitTestBehavior.opaque, onLongPress: _handleLongPress, child: widget.child ); if (_mouseIsConnected) { result = new MouseRegion( onEnter: (PointerEnterEvent _event) => _showTooltip(), onExit: (PointerExitEvent _event) => _hideTooltip(), child: result ); } return(result); }
void Start() { target = TerrainGenerator.Instance.Target; terrainSize = TerrainGenerator.Instance.TerrainSize; distance = TerrainGenerator.Instance.TriggerDistance; renderer = GetComponent <Renderer> (); decoration = GetComponent <Decoration> (); }
public override Decoration lerpTo(Decoration b, float t) { if (!(b is _CupertinoEdgeShadowDecoration)) { return(lerpCupertino(this, null, t)); } return(lerpCupertino(this, (_CupertinoEdgeShadowDecoration)b, t)); }
public Decoration this[int index] { get { Decoration decoration = new Decoration(); this._decorations.Add(index, decoration); return(this._decorations[index]); } }
private void AddDecorationMethod(object sender, RoutedEventArgs e) { string material = DecorationMaterial.Text; float price = CheckString(DecorationPrice.Text); Decoration newDecoration = new Decoration(price, material); DataContext = FlowerShop.AddStock(newDecoration); NavigationService.GoBack(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HorizontalSwapBox_CheckedChanged(object sender, EventArgs e) { if (Decoration == null) { return; } Decoration.SetSwap(ViewPositionBox.Position, HorizontalSwapBox.Checked); }
public void AddDecoration(Decoration decoration) { if (decoration == null) { throw new ArgumentException($"Decoration cannot be empty", nameof(decoration)); } Decorations.Add(decoration); }
protected virtual void AddDecoration(Decoration decoration) { if (_decorations == null) { _decorations = new List <Decoration>(); } _decorations.Add(decoration); }
public void Should_Parse_Decoration(string text, Decoration decoration) { // Given, When var result = Style.Parse(text); // Then result.ShouldNotBeNull(); result.Decoration.ShouldBe(decoration); }
public override Decoration lerpFrom(Decoration a, float t) { if (!(a is _CupertinoEdgeShadowDecoration)) { return(lerpCupertino(null, this, t)); } return(lerpCupertino((_CupertinoEdgeShadowDecoration)a, this, t)); }
private void Randomize(Decoration decoration) { decoration.transform.position = transform.position + new Vector3(Random.value - 0.5f, 0.3f + Random.value / 2f, Random.value - 0.5f).normalized *maxDistance *Random.value; Rigidbody rb = decoration.GetComponentInChildren <Rigidbody>(); rb.angularVelocity = new Vector3(Random.value, Random.value, Random.value); rb.maxAngularVelocity = Random.value * 5; rb.velocity = new Vector3(Random.value - 0.5f, Random.value - 0.5f, Random.value - 0.5f); }
public int addDecoration(DecorationDto dto) { Decoration d = new Decoration(); d.type = dto.type; _unitOfWork.DecorationRepository.Add(d); _unitOfWork.SaveChanges(); return(d.Id); }
// // GET: /Decoration/Details/5 public ActionResult Details(int id = 0) { Decoration decoration = db.Decorations.Find(id); if (decoration == null) { return(HttpNotFound()); } return(View(decoration)); }
public void PlaceNewDecorationOnSelectedTile(GameObject decorationPreFab) { GameObject decorationGo = Instantiate(decorationPreFab); Decoration decoration = decorationGo.GetComponent <Decoration>(); decoration.id = 0; decorationGo.transform.SetParent(decorationsHolder.transform); GiveToSelectedFloor(decorationGo); DeselectCurrentFloor(); }
public bool IsDefault() { return(Family.IsEmpty() && Style.IsEmpty() && Weight.IsEmpty() && Size.IsEmpty() && Decoration.IsDefault() && Align.IsDefault() && Rotation == 0.0); }
public async Task DecorationTest(int index, Decoration expected) { var page = await context.OpenAsync("http://mhgen.kiranico.com/decoration"); var trs = page.QuerySelector(".table").QuerySelectorAll("tr"); Decoration actual = await decoManager.GetDecoration(trs[index]); actual.ShouldDeepEqual(expected); }
private bool PopulateSlotDecoration(Slot slot, Decoration decoration) { if (slot != null && decoration.IsSlotCompatible(slot.Type) && slot.Decoration == null) { slot.Decoration = decoration; return(true); } return(false); }
protected override void AddDecoration(Decoration decoration) { switch (decoration.Value) { case Decoration.Enumerant.Block: Block = true; return; } base.AddDecoration(decoration); }
public TableRow( LocalKey key = null, Decoration decoration = null, List <Widget> children = null ) { this.key = key; this.decoration = decoration; this.children = children; }
public void OnRemoveListViewItem(object sender, DecorationPocketEventArgs e) { if (e.Index == selectedIndex) { selectedDecoration = null; selectedIndex = -1; } pocket.ListViewItems.RemoveAt(e.Index); UpdateDetails(); }
public static void PrintAdjust(uint indent, uint maxcol, Adjust adjust, Decoration deco, string text) { if(Formatter == null) GetDefaultFormatter(); if(maxcol == 0) maxcol = TextWidth; string sepc = null; uint sepl = 0; if(indent > 0 && (deco & Decoration.Column) != 0) { sepc = Formatter.GetIndexSeparator(); sepl = (uint)sepc.Length; } if(indent+sepl >= maxcol) indent = 0; string left = null; if(indent > 0) { if(string.IsNullOrEmpty(text)) { left = "".PadRight((int)indent); text = ""; } else if(text.Length == indent) { left = text; text = ""; } else if(text.Length <= indent) { left = text.PadRight((int)indent); text = ""; } else { left = text.Substring(0, (int)indent); text = text.Substring((int)indent); } left += sepc; } uint maxc = maxcol - (indent+sepl); string line; if(adjust != Adjust.None || text.Length > maxc) line = TextAdjust(text, maxcol-(indent+sepl), adjust, Formatter.GetEllipses()); else line = text; if(indent > 0) line = left + line; Formatter.WriteLine(line); if(deco != Decoration.None && deco != Decoration.Column) Formatter.WriteLine(DecoLine(deco, indent, maxcol)); }
private void moveLeft() { // System.out.println( "left" ); for (innerlooper = 0; innerlooper < decorSprites.length; innerlooper++) decorSprites[innerlooper][mostRightSprite.myVectorSpotX] .setX(mostLeftSprite.getX() - 64); // swap because everything moved Decoration tempSprite = mostLeftSprite; mostLeftSprite = mostRightSprite; int vectorX = mostLeftSprite.myVectorSpotX; // get lowest sectorspotx, then loop it and give it to everybody else mostLeftSprite.mySectorSpotX = tempSprite.mySectorSpotX; mostLeftSprite.mySectorX = tempSprite.mySectorX; if (mostLeftSprite.mySectorSpotX - 1 < 0) { mostLeftSprite.mySectorX--; mostLeftSprite.mySectorSpotX = LoaderBase.DATA_SQUARE - 1; } else mostLeftSprite.mySectorSpotX = tempSprite.mySectorSpotX - 1; for (innerlooper = 0; innerlooper < decorSprites.length; innerlooper++) { tempSprite = decorSprites[innerlooper][mostRightSprite.myVectorSpotX]; tempSprite.mySectorX = mostLeftSprite.mySectorX; tempSprite.mySectorSpotX = mostLeftSprite.mySectorSpotX; LoaderBase ld = getSpriteDecor(tempSprite.mySectorX, tempSprite.mySectorY); byte spriteVal = ld.getDecorData()[tempSprite.mySectorSpotX][tempSprite.mySectorSpotY]; tempSprite.setVisible(spriteVal != 0); if (tempSprite.getVisible()) tempSprite.setFrame(spriteVal); } if (vectorX - 1 < 0) vectorX = decorSprites[0].length - 1; else --vectorX; mostRightSprite = decorSprites[0][vectorX]; // updateVisibles(); }
private void moveRight() { // System.out.println( "right hit" ); // X COORDINATE SHIFT for (innerlooper = 0; innerlooper < decorSprites.length; innerlooper++) decorSprites[innerlooper][mostLeftSprite.myVectorSpotX] .setX(mostRightSprite.getX() + 64); Decoration tempSprite = mostRightSprite; mostRightSprite = mostLeftSprite; int vectorX = mostRightSprite.myVectorSpotX; // get lowest sectorspotx, then loop it and give it to everybody else mostRightSprite.mySectorSpotX = tempSprite.mySectorSpotX; mostRightSprite.mySectorX = tempSprite.mySectorX; if (mostRightSprite.mySectorSpotX + 1 >= LoaderBase.DATA_SQUARE) { mostRightSprite.mySectorX = mostRightSprite.mySectorX + 1; mostRightSprite.mySectorSpotX = 0; } else mostRightSprite.mySectorSpotX = tempSprite.mySectorSpotX + 1; for (innerlooper = 0; innerlooper < decorSprites.length; innerlooper++) { tempSprite = decorSprites[innerlooper][mostRightSprite.myVectorSpotX]; tempSprite.mySectorX = mostRightSprite.mySectorX; tempSprite.mySectorSpotX = mostRightSprite.mySectorSpotX; LoaderBase ld = getSpriteDecor(tempSprite.mySectorX, tempSprite.mySectorY); byte spriteVal = ld.getDecorData()[tempSprite.mySectorSpotX][tempSprite.mySectorSpotY]; tempSprite.setVisible(spriteVal != 0); if (tempSprite.getVisible()) tempSprite.setFrame(spriteVal); } if (vectorX + 1 >= decorSprites[0].length) vectorX = 0; else vectorX = vectorX + 1; mostLeftSprite = decorSprites[0][vectorX]; // updateVisibles(); }
public Style(Brush foreground, Brush background, Decoration decoration) { this.foreground = foreground; this.background = background; this.decoration = decoration; }
public int IndexOf(Decoration decoration) { return decorations.IndexOf(decoration); }
public override void Update() { if (this.dec == null) this.dec = Entity.decoration; // Force initial direction update if (this.movement == null) { movement = createTurnMovement(direction); movement.addProgress(1f); // Move to End movement.Update(); // Assure finalization movement.UpdateTextures(); } // If we're not moving right now if(!IsMoving){ // Let's see if we have something to do... next = RoutePlanifier.next(this.Entity); //Then, let's move :D if(next != null){ Vector3 myPosition = this.Entity.Position.transform.localPosition, otherPosition = next.transform.localPosition; // Define the movement type and set the tilesheet MovementType type = getMovementTypeTo(next); this.movement = Movement.createMovement(type, // type this.Entity, // Entity this, // Mover dec, // Decoration getSpritesheetForMovementType(type), // Sheet transform.position, // Origin next.transform.position + new Vector3(0,next.WalkingHeight+transform.localScale.y / 2,0), // Destination Entity.Position, // Cell Origin next, // Cell Destination null); // Extra Params } else if (movementEvent != null) { movementFinished = true; if (turnAfterMove) { switchDirection(turnDirection); turnAfterMove = false; } } } if(IsMoving){ // Update the progress this.movement.Update(); this.movement.UpdateTextures(); // If the movement has ended if(this.movement.Ended){ paso = !paso; } } }
/******************** * Movement factory * ***************/ public static Movement createMovement(MovementType type, Entity entity, Mover mover, Decoration dec, IsoDecoration sheet, Vector3 from, Vector3 to, Cell origin, Cell destination, Dictionary<string, object> mParams) { Movement movement = null; switch(type){ case MovementType.Lineal: movement = new LinealMovement(); break; case MovementType.Parabolic: movement = new ParabolicMovement(); break; case MovementType.Instant: movement = new InstantMovement(); break; case MovementType.Turn: movement = new TurnMovement(); break; default: movement = new LinealMovement(); break; } movement.setParams(mParams); movement.origin = origin; movement.destination = destination; movement.from = from; movement.to = to; movement.entity = entity; movement.dec = dec; movement.sheet = sheet; movement.mover = mover; return movement; }
public override void Update() { this.dec = Entity.decoration; if(!isMoving){ next = RoutePlanifier.next(this.Entity); if(next != null){ Vector3 myPosition = this.Entity.Position.transform.localPosition, otherPosition = next.transform.localPosition; MovementType type = MovementType.Lineal; if(Entity.Position.WalkingHeight != next.WalkingHeight){ type = MovementType.Parabolic; dec.IsoDec = jumpingSprite; } dec.updateTextures(); int row = 0; if(myPosition.z < otherPosition.z){ row = 0;} else if(myPosition.z > otherPosition.z){ row = 2;} else if(myPosition.x < otherPosition.x){ row = 1;} else if(myPosition.x > otherPosition.x){ row = 3;} dec.Tile = tile = row*dec.IsoDec.nCols; this.movement = Movement.createMovement(type, transform.position, next.transform.position + new Vector3(0,next.WalkingHeight+transform.localScale.y / 2,0)); this.movementProgress = 0; this.movementDuration = 0.3f; isMoving = true; }else if(movementEvent!=null) movementFinished = true; } if(isMoving){ this.movementProgress += Time.deltaTime; transform.position = this.movement.getPositionAt(this.movementProgress / this.movementDuration); if(dec.IsoDec.nCols>1){ if(this.movementProgress / this.movementDuration <0.15){ dec.Tile = tile; }else if (this.movementProgress / this.movementDuration < 0.85){ dec.Tile = tile+((paso)?1:2); }else if (this.movementProgress / this.movementDuration < 1){ dec.Tile = tile; } } if(this.movementProgress >= this.movementDuration){ this.isMoving = false; this.Entity.Position = next; int lastRow = Mathf.FloorToInt(tile/dec.IsoDec.nCols); dec.IsoDec = normalSprite; dec.updateTextures(); dec.Tile = lastRow*dec.IsoDec.nCols; paso = !paso; } } }
public Text(Align align = null, Decoration decoration = null) { Align = align; Decoration = decoration; }
public Decoration CreateDecoration(Decoration item) { throw new NotImplementedException(); }
private void AddDecorationListViewItem(Decoration decoration, int countLeft = 1) { ListViewItem listViewItem = new ListViewItem(); listViewItem.Tag = decoration; listViewItem.SnapsToDevicePixels = true; listViewItem.UseLayoutRounding = true; DockPanel dockPanel = new DockPanel(); dockPanel.Width = 170; Image image = new Image(); image.Source = ItemDatabase.GetDecorationImageFromID(decoration.ID); image.Width = 18; image.Height = 18; image.Margin = new Thickness(0, 0, 0, 0); image.VerticalAlignment = VerticalAlignment.Center; image.HorizontalAlignment = HorizontalAlignment.Left; TextBlock itemName = new TextBlock(); itemName.VerticalAlignment = VerticalAlignment.Center; itemName.Text = decoration.DecorationData.Name; itemName.TextTrimming = TextTrimming.CharacterEllipsis; itemName.Margin = new Thickness(4, 0, 0, 0); itemName.Padding = new Thickness(5, 0, 5, 0); TextBlock itemX = new TextBlock(); itemX.VerticalAlignment = VerticalAlignment.Center; itemX.HorizontalAlignment = HorizontalAlignment.Right; itemX.TextAlignment = TextAlignment.Right; itemX.Text = "x"; itemX.Width = Double.NaN; itemX.MinWidth = 10; TextBlock itemCount = new TextBlock(); itemCount.VerticalAlignment = VerticalAlignment.Center; itemCount.HorizontalAlignment = HorizontalAlignment.Right; itemCount.TextAlignment = TextAlignment.Right; itemCount.Width = 30; itemCount.Text = countLeft.ToString(); listViewItem.ToolTip = decoration.DecorationData.Description; listViewItem.Content = dockPanel; listViewDecorations.Items.Add(listViewItem); dockPanel.Children.Add(image); dockPanel.Children.Add(itemName); DockPanel.SetDock(image, Dock.Left); if (pocket.MaxStackSize == 0) { dockPanel.Children.Add(itemCount); dockPanel.Children.Add(itemX); DockPanel.SetDock(itemCount, Dock.Right); } }
public static string DecoLine(Decoration deco, uint indent, uint width) { if(Formatter == null) GetDefaultFormatter(); bool bColumns = (deco & Decoration.Column) != 0; // column separator char fill = (char)0; if ((deco & Decoration.Single) != 0) fill = Formatter.GetLine1(); else if((deco & Decoration.Double) != 0) fill = Formatter.GetLine2(); StringBuilder sb = new StringBuilder((int)width); if(bColumns) { string sepa = null; if(fill == 0) { fill = ' '; sepa = Formatter.GetColumnSeparator(); } else if((deco & Decoration.Single) != 0) sepa = Formatter.GetCross1(); else { fill = Formatter.GetLine1(); sepa = Formatter.GetCross2(); } if(indent > 0) { sb.Append(fill, (int)Math.Min(indent, width)); width = (indent >= width) ? 0 : (width - indent); } uint usep = (uint)sepa.Length; sb.Append(sepa, 0, (int)Math.Min(usep, width)); width = (usep >= width) ? 0 : (width - usep); if(width > 0) sb.Append(fill, (int)width); } else { if(fill == 0) fill = ' '; sb.Append(fill, (int)width); } return sb.ToString(); }
// public Ship parent; public ShipComponent(string name, Game1 rootGame, Ship ParentShip, string partType, Vector3 position, float rotation) : base(name, ParentShip) { this.game = rootGame; this.parent = ParentShip; this.type = partType; this.position = position; myDepth = ParentShip.numParts; position2 = position; string[] varietyfinder = partType.Split('_'); variety = varietyfinder[1]; Angle = rotation; mag = Math.Sqrt(position2.X * position2.X + position2.Y * position2.Y); myEffectDecorations = new List<Decoration>(); parentShip = (Ship)parent; if (position.Y == 0) { relativeTheta = 0; } else { if (position.X < 0) { relativeTheta = Math.Atan(position.Y / position2.X) + Math.PI; } else { relativeTheta = Math.Atan(position.Y / position2.X); } } myEffect = SpriteEffects.None; orientation = new Components.OrientationComponent(); if (position.X < 0) { //orientation.scale.Y = -orientation.scale.Y; myEffect = SpriteEffects.FlipHorizontally; } position.Z = myDepth / 100; Console.WriteLine(position.Z); orientation = new Components.OrientationComponent(); orientation.position = position; orientation.rotation = rotation; components.Add(Components.OrientationComponent.getTypeName(), orientation); Decoration decor; switch (partType) { case "USF1_Engine_1": imageOrigin = new Vector2(75, 20); health = 100; thrust = .5f; maneuverability = .25f; powerConsumption = 1.1f; decor = new Decoration( "shipTrail", game, this, new aotv.Components.GraphicsComponent(game.Content.Load<Texture2D>("engineThrust")), new aotv.Components.OrientationComponent(orientation.rotation) ); decor.graphics.color = Color.Cyan; decor.graphics.center = new Vector2(40, 331); decor.orientation.rotation -= MathHelper.Pi; decor.orientation.parent = orientation; game.core.addObject(decor); // trail myTrailDecorations = new Decoration[myTrailSize]; myTrailDrift = new Vector3[myTrailSize]; for (int i = 0; i < myTrailDecorations.Length; i++) { decor = new Decoration( "particle2", game, null, new aotv.Components.GraphicsComponent(game.Content.Load<Texture2D>("particle2")), new aotv.Components.OrientationComponent(orientation.rotation) ); decor.orientation.position = orientation.position + parentShip.orientation.position; decor.orientation.rotation -= MathHelper.Pi; decor.orientation.parent = orientation; decor.graphics.opacity = 0; decor.graphics.center = new Vector2(50, 50); decor.graphics.color = Color.DarkGray; myTrailDecorations[i] = decor; game.core.addObject(decor); myTrailDrift[i] = orientation.worldPosition; myTrailDrift[i].Z = 0.01f; } break; case "USF1_Base_1": imageOrigin = new Vector2(107, 160); health = 1000; mass = 2; break; case "USF1_Crew_1": imageOrigin = new Vector2(55, 59); health = 50; mass = .5; break; case "USF1_Hull_1": imageOrigin = new Vector2(46, 188); health = 200; mass = 1.5; break; case "USF1_Hull_2": imageOrigin = new Vector2(77, 112); health = 300; mass = 2; break; case "neutral_asteroid_1": imageOrigin = new Vector2(93, 122); health = 100; break; case "RUF1_Hull_1": health = 1000; mass = 2; break; case "RUF1_Hull_2": health = 50; mass = .5; break; case "RUF1_Hull_3": health = 200; mass = 1.5; break; case "RUF1_Crew_1": health = 300; mass = 2; break; case "RUF1_Energy_1": imageOrigin = new Vector2(30, 120); powerGeneration = 1; health = 100; mass = 2; break; case "RUF1_Engine_1": health = 100; thrust = .3f; maneuverability = .25f; powerConsumption = 1.1f; Debug.WriteLine("DECOR"); decor = new Decoration( "shipTrail", game, this, new aotv.Components.GraphicsComponent(game.Content.Load<Texture2D>("engineThrust")), new aotv.Components.OrientationComponent(orientation.rotation) ); decor.graphics.color = Color.OrangeRed; decor.graphics.center = new Vector2(40, 331); decor.orientation.position.Z = .1f; decor.orientation.rotation -= MathHelper.Pi; game.core.addObject(decor); myEffectDecorations.Add(decor); decor = new Decoration( "engineRadiance", game, this, new aotv.Components.GraphicsComponent(game.Content.Load<Texture2D>("engineRadiance")), new aotv.Components.OrientationComponent(orientation.rotation) ); decor.orientation.position.Z = .2f; decor.graphics.color = Color.OrangeRed; decor.graphics.center = new Vector2(50, 50); decor.orientation.rotation -= MathHelper.Pi; game.core.addObject(decor); myEffectDecorations.Add(decor); // trail myTrailDecorations = new Decoration[myTrailSize]; myTrailDrift = new Vector3[myTrailSize]; for (int i = 0; i < myTrailDecorations.Length; i++) { decor = new Decoration( "particle2", game, null, new aotv.Components.GraphicsComponent(game.Content.Load<Texture2D>("particle2")), new aotv.Components.OrientationComponent(orientation.rotation) ); decor.orientation.position = orientation.position + parentShip.orientation.position; decor.orientation.rotation -= MathHelper.Pi; decor.orientation.parent = orientation; decor.graphics.opacity = 0; decor.graphics.center = new Vector2(50, 50); decor.graphics.color = Color.White; myTrailDecorations[i] = decor; game.core.addObject(decor); myTrailDrift[i] = orientation.worldPosition; myTrailDrift[i].Z = 0.01f; } break; } // Load resources from main ContentManager and store references graphics = new Components.GraphicsComponent(rootGame.Content.Load<Texture2D>(partType)); graphics.effect = myEffect; if (graphics.center == null) { graphics.center = new Vector2(graphics.texture.Width / 2, graphics.texture.Height / 2); } components.Add(Components.GraphicsComponent.getTypeName(), graphics); }
public void removeDecoration(Decoration d) { }
/// <summary> /// Method for adding a random decoration object /// </summary> private void AddDecoration(Vector3 position, Vector3 relativePosition) { string name; Decoration deco; switch (GameEnvironment.Random.Next(6)) { case 0: name = "Closet"; deco = new Decoration("Misc Level Objects\\" + name + "\\" + name + " Model", name); break; case 1: name = "Cupboard"; deco = new Decoration("Misc Level Objects\\" + name + "\\" + name + " Model", name); break; case 2: name = "Table"; deco = new Decoration("Misc Level Objects\\" + name + "\\" + name + " Model", name); break; case 3: name = "Chair"; deco = new Decoration("Misc Level Objects\\" + name + "\\" + name + " Model", name); break; case 4: name = "Cupboard2"; deco = new Decoration("Misc Level Objects\\" + name + "\\" + name + " Model", name); break; case 5: switch (GameEnvironment.Random.Next(400)) { case 0: name = "Confused Cat"; break; case 1: name = "Surprise Cat"; break; case 2: name = "Sir Quokkalot"; break; case 3: name = "Shocked Cat"; break; case 4: name = "Baker Cat"; break; default: int index = random.Next(2); if (index == 0) name = "Lakeview"; else name = "Village"; break; } deco = new Decoration("Misc Level Objects\\Painting\\" + name + "\\" + name + " Model", name); break; default: return; } deco.Parent = this; gameObjects.Add(deco); deco.Position = position - new Vector3(relativePosition.X * deco.OffsetX(name), deco.OffsetY(name), relativePosition.Z * deco.OffsetX(name)); if (relativePosition.Z == -1) deco.modelRotation = (float)Math.PI / 180 * 270; else if (relativePosition.X == 1) deco.modelRotation = (float)Math.PI / 180 * 180; else if (relativePosition.Z == 1) deco.modelRotation = (float)Math.PI / 180 * 90; else if (relativePosition.X == -1) deco.modelRotation = 0; }
public override void tick() { if (this.dec == null) this.dec = Entity.decoration; if(movementFinished) finalizeMovementEvent(); if (stop) { if (IsMoving) finalizeMovementEvent(); // Cancel all pending operations this.move = false; this.teleport = false; this.turn = false; } else if(teleport) { if (IsMoving) finalizeMovementEvent(); teleportTo(teleportToCell); teleportToCell = null; teleport = false; } else if(move) { if (IsMoving) finalizeMovementEvent(); movementEvent = bcEvent; moveTo(moveToCell); this.move = false; } else if (turn) { if (IsMoving) finalizeMovementEvent(); switchDirection(turnDirection); turn = false; } // Direction change responsive update if (!IsMoving && movementEvent == null) if (lastDirection != direction) switchDirection(direction); // Direction change ignore lastDirection = direction; }
/// <summary> /// Load a single Tile from a certain position in the file /// </summary> /// <param name="chr">The character in the file, defines what tile it will be</param> /// <param name="x">The x-coördinate</param> /// <param name="y">The y-coördinate</param> /// <returns>The Tile to Load</returns> private Tile LoadTile(char chr, int x, int y, string name) { if (chr == 'W') return new WallTile("01"); else if (chr == 'P') return new PathTile("01"); else if (chr == 'N') { //place the player in the entry tile player.Position = new Vector3(x * 200, 200f, y * 200); return new EntryTile("01"); } else if (chr == 'X') { ExitTile exitTile = new ExitTile("01"); if (name == "Content\\Special Levels\\Final.txt") exitTile.exitObject = new Object3D("Misc Level Objects\\Pistol\\Pistol Model"); return exitTile; } else if (chr == 'K') { Decoration notepad = new Decoration("Misc Level Objects\\NotePad\\NotePad Model", "Notepad"); notepad.Position = new Vector3(x * 200, 102, y * 200); notepad.Parent = this; gameObjects.Add(notepad); return new PathTile("01"); } else if (chr == 'D') { Decoration door = new Decoration("Misc Level Objects\\Door\\Door Model", "Door"); door.Position = new Vector3(x * 200, 155, y * 200 + 100); door.modelRotation = (float)Math.PI / 180 * 90; door.Parent = this; gameObjects.Add(door); player.Position = new Vector3(x * 200, 200f, y * 200); return new PathTile("01"); } else if (chr == 'C') { Decoration closet = new Decoration("Misc Level Objects\\Closet\\Closet Model", "Closet"); closet.Position = new Vector3(x * 200, 190, y * 200 - 80); closet.Parent = this; closet.modelRotation = (float)Math.PI / 180 * 270; gameObjects.Add(closet); return new PathTile("01"); } else if (chr == 'V') { Decoration cupboard = new Decoration("Misc Level Objects\\Cupboard\\Cupboard Model", "Cupboard"); cupboard.Position = new Vector3(x * 200 + 100, 165, y * 200); cupboard.Parent = this; cupboard.modelRotation = (float)Math.PI / 180 * 180; gameObjects.Add(cupboard); return new PathTile("01"); } else if (chr == '1') return new WallTile("No Exit Left"); else if (chr == '2') return new WallTile("No Exit Middle"); else if (chr == '3') return new WallTile("No Exit Right"); else return null; }
// Use this for initialization void Start() { dec = this.GetComponent<Decoration> (); }
private void moveUp() { // System.out.println( "hit up" ); for (innerlooper = 0; innerlooper < decorSprites[0].length; innerlooper++) decorSprites[mostDownSprite.myVectorSpotY][innerlooper] .setY(mostUpSprite.getY() - 64); // swap because everything moved Decoration tempSprite = mostUpSprite; mostUpSprite = mostDownSprite; int vectorY = mostUpSprite.myVectorSpotY; // get lowest sectorspotx, then loop it and give it to everybody else mostUpSprite.mySectorSpotY = tempSprite.mySectorSpotY; mostUpSprite.mySectorY = tempSprite.mySectorY; if (mostUpSprite.mySectorSpotY - 1 < 0) { mostUpSprite.mySectorY--; mostUpSprite.mySectorSpotY = LoaderBase.DATA_SQUARE - 1; } else mostUpSprite.mySectorSpotY = tempSprite.mySectorSpotY - 1; for (innerlooper = 0; innerlooper < decorSprites[0].length; innerlooper++) { tempSprite = decorSprites[mostDownSprite.myVectorSpotY][innerlooper]; tempSprite.mySectorY = mostUpSprite.mySectorY; tempSprite.mySectorSpotY = mostUpSprite.mySectorSpotY; LoaderBase ld = getSpriteDecor(tempSprite.mySectorX, tempSprite.mySectorY); byte spriteVal = ld.getDecorData()[tempSprite.mySectorSpotX][tempSprite.mySectorSpotY]; tempSprite.setVisible(spriteVal != 0); if (tempSprite.getVisible()) tempSprite.setFrame(spriteVal); } if (vectorY - 1 < 0) vectorY = decorSprites.length - 1; else --vectorY; mostDownSprite = decorSprites[vectorY][0]; // updateVisibles(); }
/* TextTool.PrintAdjust( 9, 0, TextTool.Adjust.Center, TextTool.Decoration.Column, "123456789Demonstration of a very cool Tool"); TextTool.PrintIndent( 9, 0, TextTool.Decoration.Single | TextTool.Decoration.Column, "Lines Wenn ich einmal reich bin,\ndudel diedel dudel dumm.\n" + "Eins und eins das macht zwei - die nächste Zahl ist drei!"); TextTool.PrintIndent( 9, 0, TextTool.Decoration.Single | TextTool.Decoration.Column, "Hallo Wenn ich einmal reich bin, dudel diedel dudel dumm." + "Eins und eins das macht zwei - die nächste Zahl ist drei!\n" + "Und der Quatsch geht immer noch weiter."); TextTool.PrintIndent( 9, 0, TextTool.Decoration.Single | TextTool.Decoration.Column, "Zwei die Zahl nach eins Donaudampfschiffahrtsgesellschaft"); TextTool.PrintIndent( 9, 0, TextTool.Decoration.Single | TextTool.Decoration.Double | TextTool.Decoration.Column, "Drei noch eine"); */ public static void PrintIndent(int indent, uint width, Decoration deco, string text) { if(Formatter == null) GetDefaultFormatter(); if(width == 0) width = TextWidth; if((deco & Decoration.Single) != 0) Formatter.WriteLine(DecoLine(deco, (uint)Math.Abs(indent), width)); if(text != null) { uint uwid = width; uint usep = 0; if((deco & Decoration.Column) != 0) { usep = (uint)Formatter.GetIndexSeparator().Length; if (indent + usep >= uwid) { usep = 0; indent = 0; } else uwid -= usep; } string[] lines = TextIndent(text, indent, uwid); foreach(string line in lines) { if(usep > 0) PrintAdjust((uint)Math.Abs(indent), width, Adjust.None, Decoration.Column, line); else Formatter.WriteLine(line); } } if((deco & Decoration.Double) != 0) Formatter.WriteLine(DecoLine(Decoration.Double | (deco & Decoration.Column), (uint)Math.Abs(indent), width)); }
private void loadData() { Decoration s; int ww = MainGame.Width; int hh = MainGame.Height; int _terrainTileWidth = (ww / 32) + MainGame.ADDONWIDTH; int _terrainTileHeight = (hh / 32) + MainGame.ADDONHEIGHT; _terrainTileWidth -= _terrainTileWidth % 4; _terrainTileHeight -= _terrainTileHeight % 4; int i, j; byte spriteVal; LoaderBase ld; int _terrainTileCollectionWidth = _terrainTileWidth / 2; int _terrainTileCollectionHeight = _terrainTileHeight / 2; decorSprites = new Decoration[_terrainTileCollectionHeight][_terrainTileCollectionWidth]; for (i = 0; i < _terrainTileCollectionHeight; i = i + 1) { for (j = 0; j < _terrainTileCollectionWidth; j = j + 1) { s = new Decoration(); decorSprites[i][j] = s; if (i == 0 && j == 0) mostLeftSprite = mostUpSprite = s; else if (i == _terrainTileCollectionHeight - 1 && j == _terrainTileCollectionWidth - 1) mostRightSprite = mostDownSprite = s; s.mySectorX = spawnX; s.mySectorY = spawnY; s.myVectorSpotX = j; s.myVectorSpotY = i; s.mySectorSpotX = j; s.mySectorSpotY = i; s.setX(j * 64); s.setY(i * 64); ld = getSpriteDecor(s.mySectorX, s.mySectorY); spriteVal = ld.getDecorData()[s.mySectorSpotX][s.mySectorSpotY]; s.setVisible(spriteVal != 0); if (s.getVisible()) s.setFrame(spriteVal); } } _decorsLoaded = true; }
public bool UpdateDecoration(Decoration item) { throw new NotImplementedException(); }