Beispiel #1
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            var prop = Property as EdgeDrawProperty;

            if (prop == null)
            {
                return;
            }

            Drawers.Clear();

            var startVertexDrawerProp = new VertexDrawProperty();

            startVertexDrawerProp.Color    = prop.StartVertexColor;
            startVertexDrawerProp.Position = prop.StartVertex;
            Drawers.Add(new VertexDrawer(startVertexDrawerProp));

            var lineDrawerProp = new LineDrawerProperty();

            lineDrawerProp.Color       = prop.LineColor;
            lineDrawerProp.StartVertex = prop.StartVertex;
            lineDrawerProp.EndVertex   = prop.EndVertex;
            Drawers.Add(new LineDrawer(lineDrawerProp));

            var endVertexDrawerProp = new VertexDrawProperty();

            endVertexDrawerProp.Color    = prop.EndVertexColor;
            endVertexDrawerProp.Position = prop.EndVertex;
            Drawers.Add(new VertexDrawer(endVertexDrawerProp));
        }
Beispiel #2
0
 public Collideable()
 {
     Drawers.Add(new HitboxDrawer());
     Behaviors.Add(new SpawnOnRemovalBehavior {
         Prototype = new Decoration()
         {
             BaseTexture = "explosion", LengthMs = 600, LengthVariance = 300
         }, InheritSize = true
     });
     CollisionBoxScale = 1;
 }
Beispiel #3
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            var prop = Property as TriangleDrawProperty;

            if (prop == null)
            {
                return;
            }

            Drawers.Clear();

            var vertexAProp = new VertexDrawProperty();

            vertexAProp.Color    = prop.VertexAColor;
            vertexAProp.Position = prop.VertexA;
            Drawers.Add(new VertexDrawer(vertexAProp));

            var lineABDrawerProp = new LineDrawerProperty();

            lineABDrawerProp.Color       = prop.EdgeABColor;
            lineABDrawerProp.StartVertex = prop.VertexA;
            lineABDrawerProp.EndVertex   = prop.VertexB;
            Drawers.Add(new LineDrawer(lineABDrawerProp));

            var vertexBProp = new VertexDrawProperty();

            vertexBProp.Color    = prop.VertexAColor;
            vertexBProp.Position = prop.VertexB;
            Drawers.Add(new VertexDrawer(vertexBProp));

            var lineBCDrawerProp = new LineDrawerProperty();

            lineBCDrawerProp.Color       = prop.EdgeBCColor;
            lineBCDrawerProp.StartVertex = prop.VertexB;
            lineBCDrawerProp.EndVertex   = prop.VertexC;
            Drawers.Add(new LineDrawer(lineBCDrawerProp));

            var vertexCProp = new VertexDrawProperty();

            vertexCProp.Color    = prop.VertexCColor;
            vertexCProp.Position = prop.VertexC;
            Drawers.Add(new VertexDrawer(vertexCProp));

            var lineCADrawerProp = new LineDrawerProperty();

            lineCADrawerProp.Color       = prop.EdgeCAColor;
            lineCADrawerProp.StartVertex = prop.VertexC;
            lineCADrawerProp.EndVertex   = prop.VertexA;
            Drawers.Add(new LineDrawer(lineCADrawerProp));
        }
Beispiel #4
0
        public void AddNewGuestDrawer()
        {
            if (Drawers.Select(d => d.Name).Contains(NewGuestDrawer) || string.IsNullOrWhiteSpace(NewGuestDrawer))
            {
                return;
            }
            Drawers.Add(new Drawer(NewGuestDrawer,
                                   "https://i.imgur.com/EHWNFi5.png")
            {
                IsGuest = true
            });

            //PickedDrawers = new List<Drawer>();           //TU
        }
Beispiel #5
0
 public Player()
 {
     BaseTexture = "player_new";
     R           = 4 * textureScale;
     Behaviors.Add(controlBehavior);
     Behaviors.Add(new FramedMovementBehavior());
     Drawers.Add(manaDrawer);
     Drawers.Add(paybackDrawer);
     Health         = new Health(this, 9);
     Mana           = new Consumable(20);
     Payback        = new Consumable(1000);
     IsFriendly     = true;
     Mana.Amount    = 0;
     Payback.Amount = 0;
 }
Beispiel #6
0
 /// <summary>
 /// Add a new user to the lobby
 /// </summary>
 /// <param name="User">User object describing the new user</param>
 public void AddUser(User User)
 {
     Drawers.Add(User.SessionId, User);
 }